d2787b
From e9e1b0bc6e2deaf44190636ab6826065ed3c0392 Mon Sep 17 00:00:00 2001
d2787b
From: Pranith Kumar Karampuri <pranith.karampuri@phonepe.com>
d2787b
Date: Wed, 3 Feb 2021 18:10:40 +0530
d2787b
Subject: [PATCH 552/584] cluster/afr: Change default self-heal-window-size to
d2787b
 1MB (#2068)
d2787b
d2787b
At the moment self-heal-window-size is 128KB. This leads to healing data
d2787b
in 128KB chunks. With the growth of data and the avg file sizes
d2787b
nowadays, 1MB seems like a better default.
d2787b
d2787b
Upstream patch details:
d2787b
> https://github.com/gluster/glusterfs/pull/2111
d2787b
> Change-Id: I70c42c83b16c7adb53d6b5762969e878477efb5c
d2787b
> Fixes: #2067
d2787b
> Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>
d2787b
d2787b
BUG: 1946171
d2787b
Change-Id: Icd6a5c02ca16a1a6095f7bc10feed8ddc2505f41
d2787b
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
d2787b
Reviewed-on: https://code.engineering.redhat.com/gerrit/c/rhs-glusterfs/+/244557
d2787b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d2787b
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d2787b
---
d2787b
 xlators/cluster/afr/src/afr-self-heal-data.c | 6 ++++++
d2787b
 xlators/cluster/afr/src/afr.c                | 6 +++---
d2787b
 2 files changed, 9 insertions(+), 3 deletions(-)
d2787b
d2787b
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
d2787b
index b97c66b..156cb18 100644
d2787b
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
d2787b
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
d2787b
@@ -337,6 +337,12 @@ afr_selfheal_data_do(call_frame_t *frame, xlator_t *this, fd_t *fd, int source,
d2787b
     }
d2787b
 
d2787b
     block = 128 * 1024 * priv->data_self_heal_window_size;
d2787b
+    if (HAS_HOLES((&replies[source].poststat))) {
d2787b
+        /*Reduce the possibility of data-block allocations in case of files
d2787b
+         * with holes. Correct way to fix it would be to use seek fop while
d2787b
+         * healing data*/
d2787b
+        block = 128 * 1024;
d2787b
+    }
d2787b
 
d2787b
     type = afr_data_self_heal_type_get(priv, healed_sinks, source, replies);
d2787b
 
d2787b
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
d2787b
index 33fe4d8..0956e5a 100644
d2787b
--- a/xlators/cluster/afr/src/afr.c
d2787b
+++ b/xlators/cluster/afr/src/afr.c
d2787b
@@ -910,12 +910,12 @@ struct volume_options options[] = {
d2787b
      .type = GF_OPTION_TYPE_INT,
d2787b
      .min = 1,
d2787b
      .max = 1024,
d2787b
-     .default_value = "1",
d2787b
+     .default_value = "8",
d2787b
      .op_version = {1},
d2787b
      .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE | OPT_FLAG_DOC,
d2787b
      .tags = {"replicate"},
d2787b
-     .description = "Maximum number blocks per file for which self-heal "
d2787b
-                    "process would be applied simultaneously."},
d2787b
+     .description = "Maximum number of 128KB blocks per file for which "
d2787b
+                    "self-heal process would be applied simultaneously."},
d2787b
     {.key = {"metadata-self-heal"},
d2787b
      .type = GF_OPTION_TYPE_BOOL,
d2787b
      .default_value = "off",
d2787b
-- 
d2787b
1.8.3.1
d2787b