Blob Blame History Raw
From e9e1b0bc6e2deaf44190636ab6826065ed3c0392 Mon Sep 17 00:00:00 2001
From: Pranith Kumar Karampuri <pranith.karampuri@phonepe.com>
Date: Wed, 3 Feb 2021 18:10:40 +0530
Subject: [PATCH 552/584] cluster/afr: Change default self-heal-window-size to
 1MB (#2068)

At the moment self-heal-window-size is 128KB. This leads to healing data
in 128KB chunks. With the growth of data and the avg file sizes
nowadays, 1MB seems like a better default.

Upstream patch details:
> https://github.com/gluster/glusterfs/pull/2111
> Change-Id: I70c42c83b16c7adb53d6b5762969e878477efb5c
> Fixes: #2067
> Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>

BUG: 1946171
Change-Id: Icd6a5c02ca16a1a6095f7bc10feed8ddc2505f41
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/c/rhs-glusterfs/+/244557
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
---
 xlators/cluster/afr/src/afr-self-heal-data.c | 6 ++++++
 xlators/cluster/afr/src/afr.c                | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index b97c66b..156cb18 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -337,6 +337,12 @@ afr_selfheal_data_do(call_frame_t *frame, xlator_t *this, fd_t *fd, int source,
     }
 
     block = 128 * 1024 * priv->data_self_heal_window_size;
+    if (HAS_HOLES((&replies[source].poststat))) {
+        /*Reduce the possibility of data-block allocations in case of files
+         * with holes. Correct way to fix it would be to use seek fop while
+         * healing data*/
+        block = 128 * 1024;
+    }
 
     type = afr_data_self_heal_type_get(priv, healed_sinks, source, replies);
 
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 33fe4d8..0956e5a 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -910,12 +910,12 @@ struct volume_options options[] = {
      .type = GF_OPTION_TYPE_INT,
      .min = 1,
      .max = 1024,
-     .default_value = "1",
+     .default_value = "8",
      .op_version = {1},
      .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE | OPT_FLAG_DOC,
      .tags = {"replicate"},
-     .description = "Maximum number blocks per file for which self-heal "
-                    "process would be applied simultaneously."},
+     .description = "Maximum number of 128KB blocks per file for which "
+                    "self-heal process would be applied simultaneously."},
     {.key = {"metadata-self-heal"},
      .type = GF_OPTION_TYPE_BOOL,
      .default_value = "off",
-- 
1.8.3.1