From 2453fd874197f84e11ae70053cff7f56a32988f4 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 1 Aug 2024 14:35:16 +0000 Subject: automatic import of glusterfs --- ...ake-number-of-signer-threads-configurable.patch | 594 +++++++++++++++++++++ 1 file changed, 594 insertions(+) create mode 100644 0446-bitrot-Make-number-of-signer-threads-configurable.patch (limited to '0446-bitrot-Make-number-of-signer-threads-configurable.patch') diff --git a/0446-bitrot-Make-number-of-signer-threads-configurable.patch b/0446-bitrot-Make-number-of-signer-threads-configurable.patch new file mode 100644 index 0000000..8eb2089 --- /dev/null +++ b/0446-bitrot-Make-number-of-signer-threads-configurable.patch @@ -0,0 +1,594 @@ +From 866a4c49ad9c5a9125814a9f843d4c7fd967ab2b Mon Sep 17 00:00:00 2001 +From: Kotresh HR +Date: Mon, 3 Feb 2020 18:10:17 +0530 +Subject: [PATCH 446/449] bitrot: Make number of signer threads configurable + +The number of signing process threads (glfs_brpobj) +is set to 4 by default. The recommendation is to set +it to number of cores available. This patch makes it +configurable as follows + +gluster vol bitrot signer-threads + +> fixes: bz#1797869 +> Change-Id: Ia883b3e5e34e0bc8d095243508d320c9c9c58adc +> Signed-off-by: Kotresh HR +> (Cherry pick from commit 8fad76650bd85463708f59d2518f5b764ae4c702) +> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/24091/) + +BUG: 1790336 +Change-Id: Ia883b3e5e34e0bc8d095243508d320c9c9c58adc +Signed-off-by: Mohit Agrawal +Reviewed-on: https://code.engineering.redhat.com/gerrit/202780 +Reviewed-by: Sunil Kumar Heggodu Gopala Acharya +--- + cli/src/cli-cmd-parser.c | 29 +++++++- + cli/src/cli-cmd-volume.c | 12 +++ + doc/gluster.8 | 6 ++ + libglusterfs/src/glusterfs/common-utils.h | 1 + + rpc/xdr/src/cli1-xdr.x | 1 + + tests/bitrot/br-signer-threads-config-1797869.t | 73 +++++++++++++++++++ + xlators/features/bit-rot/src/bitd/bit-rot.c | 45 +++++++++--- + xlators/features/bit-rot/src/bitd/bit-rot.h | 20 ++--- + .../bit-rot/src/stub/bit-rot-stub-mem-types.h | 1 + + xlators/mgmt/glusterd/src/glusterd-bitrot.c | 85 ++++++++++++++++++++++ + xlators/mgmt/glusterd/src/glusterd-volgen.c | 16 ++-- + xlators/mgmt/glusterd/src/glusterd-volume-set.c | 9 +++ + 12 files changed, 270 insertions(+), 28 deletions(-) + create mode 100644 tests/bitrot/br-signer-threads-config-1797869.t + +diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c +index 7446b95..5fd05f4 100644 +--- a/cli/src/cli-cmd-parser.c ++++ b/cli/src/cli-cmd-parser.c +@@ -5661,7 +5661,7 @@ cli_cmd_bitrot_parse(const char **words, int wordcount, dict_t **options) + char *volname = NULL; + char *opwords[] = { + "enable", "disable", "scrub-throttle", "scrub-frequency", "scrub", +- "signing-time", NULL}; ++ "signing-time", "signer-threads", NULL}; + char *scrub_throt_values[] = {"lazy", "normal", "aggressive", NULL}; + char *scrub_freq_values[] = {"hourly", "daily", "weekly", "biweekly", + "monthly", "minute", NULL}; +@@ -5669,6 +5669,7 @@ cli_cmd_bitrot_parse(const char **words, int wordcount, dict_t **options) + dict_t *dict = NULL; + gf_bitrot_type type = GF_BITROT_OPTION_TYPE_NONE; + int32_t expiry_time = 0; ++ int32_t signer_th_count = 0; + + GF_ASSERT(words); + GF_ASSERT(options); +@@ -5849,6 +5850,31 @@ cli_cmd_bitrot_parse(const char **words, int wordcount, dict_t **options) + } + goto set_type; + } ++ } else if (!strcmp(words[3], "signer-threads")) { ++ if (!words[4]) { ++ cli_err( ++ "Missing signer-thread value for bitrot " ++ "option"); ++ ret = -1; ++ goto out; ++ } else { ++ type = GF_BITROT_OPTION_TYPE_SIGNER_THREADS; ++ ++ signer_th_count = strtol(words[4], NULL, 0); ++ if (signer_th_count < 1) { ++ cli_err("signer-thread count should not be less than 1"); ++ ret = -1; ++ goto out; ++ } ++ ++ ret = dict_set_uint32(dict, "signer-threads", ++ (unsigned int)signer_th_count); ++ if (ret) { ++ cli_out("Failed to set dict for bitrot"); ++ goto out; ++ } ++ goto set_type; ++ } + } else { + cli_err( + "Invalid option %s for bitrot. Please enter valid " +@@ -5857,7 +5883,6 @@ cli_cmd_bitrot_parse(const char **words, int wordcount, dict_t **options) + ret = -1; + goto out; + } +- + set_type: + ret = dict_set_int32(dict, "type", type); + if (ret < 0) +diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c +index f33fc99..72504ca 100644 +--- a/cli/src/cli-cmd-volume.c ++++ b/cli/src/cli-cmd-volume.c +@@ -3236,6 +3236,16 @@ struct cli_cmd bitrot_cmds[] = { + {"volume bitrot {enable|disable}", NULL, /*cli_cmd_bitrot_cbk,*/ + "Enable/disable bitrot for volume "}, + ++ {"volume bitrot signing-time ", ++ NULL, /*cli_cmd_bitrot_cbk,*/ ++ "Waiting time for an object after last fd is closed to start signing " ++ "process"}, ++ ++ {"volume bitrot signer-threads ", ++ NULL, /*cli_cmd_bitrot_cbk,*/ ++ "Number of signing process threads. Usually set to number of available " ++ "cores"}, ++ + {"volume bitrot scrub-throttle {lazy|normal|aggressive}", + NULL, /*cli_cmd_bitrot_cbk,*/ + "Set the speed of the scrubber for volume "}, +@@ -3251,6 +3261,8 @@ struct cli_cmd bitrot_cmds[] = { + "the scrubber. ondemand starts the scrubber immediately."}, + + {"volume bitrot {enable|disable}\n" ++ "volume bitrot signing-time \n" ++ "volume bitrot signer-threads \n" + "volume bitrot scrub-throttle {lazy|normal|aggressive}\n" + "volume bitrot scrub-frequency {hourly|daily|weekly|biweekly" + "|monthly}\n" +diff --git a/doc/gluster.8 b/doc/gluster.8 +index 66bdb48..084346d 100644 +--- a/doc/gluster.8 ++++ b/doc/gluster.8 +@@ -244,6 +244,12 @@ Use "!