summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-common.c
diff options
context:
space:
mode:
authorShreyas Siravara <sshreyas@fb.com>2017-04-10 12:36:21 -0700
committerJeff Darcy <jeff@pl.atyp.us>2017-12-11 15:10:32 +0000
commitf9b6174a7f5eb6475ca9780b062bfb3ff1132b2d (patch)
tree2f91a5a0f40e593b7a2205fe6e63b2e36651e549 /xlators/storage/posix/src/posix-common.c
parentb59e62e27cc59fa59d0f89aae2ddf115c939aa71 (diff)
posix: Add option to disable nftw() based deletes when purging the landfill directory
Summary: - We may have found an issue where certain directories were being moved into .landfill and then being quickly purged via nftw(). - We would like to have an emergency option to disable these purges. > Reviewed-on: https://review.gluster.org/18253 > Reviewed-by: Shreyas Siravara <sshreyas@fb.com> Fixes #371 Change-Id: I90b54c535930c1ca2925a928728199b6b80eadd9 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-common.c')
-rw-r--r--xlators/storage/posix/src/posix-common.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
index 1b2bb60..fa2655e 100644
--- a/xlators/storage/posix/src/posix-common.c
+++ b/xlators/storage/posix/src/posix-common.c
@@ -382,6 +382,20 @@ posix_reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("shared-brick-count", priv->shared_brick_count,
options, int32, out);
+
+ GF_OPTION_RECONF ("disable-landfill-purge",
+ priv->disable_landfill_purge,
+ options, bool, out);
+ if (priv->disable_landfill_purge) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Janitor WILL NOT purge the landfill directory. "
+ "Your landfill directory"
+ " may fill up this brick.");
+ } else {
+ gf_msg_debug (this->name, 0, "Janitor will purge the landfill "
+ "directory, which is default behavior");
+ }
+
GF_OPTION_RECONF ("force-create-mode", force_create_mode,
options, int32, out);
priv->force_create_mode = force_create_mode;
@@ -1064,6 +1078,16 @@ posix_init (xlator_t *this)
GF_OPTION_INIT ("batch-fsync-delay-usec", _private->batch_fsync_delay_usec,
uint32, out);
+
+ GF_OPTION_INIT ("disable-landfill-purge",
+ _private->disable_landfill_purge, bool, out);
+ if (_private->disable_landfill_purge) {
+ gf_msg (this->name, GF_LOG_WARNING, 0, 0,
+ "Janitor WILL NOT purge the landfill directory. "
+ "Your landfill directory"
+ " may fill up this brick.");
+ }
+
GF_OPTION_INIT ("force-create-mode", force_create, int32, out);
_private->force_create_mode = force_create;
@@ -1288,6 +1312,15 @@ struct volume_options options[] = {
" Useful for displaying the proper usable size through statvfs() "
"call (df command)",
},
+ {
+ .key = {"disable-landfill-purge"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "off",
+ .description = "Disable glusterfs/landfill purges. "
+ "WARNING: This can fill up a brick.",
+ .op_version = {GD_OP_VERSION_4_0_0},
+ .tags = {"diagnosis"},
+ },
{ .key = {"force-create-mode"},
.type = GF_OPTION_TYPE_INT,
.min = 0000,