From 21515b3331d8d72011fef79008bcaff8ca43647a Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Tue, 14 Apr 2015 14:42:46 +0530 Subject: feature/changelog: Capture path for deletes PROBLEM: There is no way to get the path of deleted file if we have gfid from changelog since the file is already deleted. SOLUTION: Do a recursive readlink on parent gfid in backend .glusterfs path to get the complete path in I/O callpath in changelog translator and capture it in callback. The path captured is relative from the brick root. The field separator used is '\0'. e.g., ......\0/bname\0\0 ADDITIONAL REQUIRED CHANGES: 1. The changelog translator option called "changelog.capture-del-path" is introduced to enable or disable the capturing of deleted entry path. e.g., gluster vol set changelog.capture-del-path on/off If capture-del-path is disabled, '\0' is captured instead of relative path. e.g., ......\0/bname\0\0\0 2. The minor number in the version of changelog is bumped up from v1.1 to v1.2. 3. If recursive readlink is failed for some reason, it will capture \0 in place of . e.g., ......\0/bname\0\0\0 (same as when caputre-del-path option is disabled) 4. If bname argument passed to "resolve_pargfid_to_path" function is NULL and pargfid is ROOT, "." is returned. This is not the case with changelog, where bname is always passed. This is applicable to other consumers of "resolve_pargfid_to_path" routine. NOTE: Changelog parser should consider the above new changes and should parse accordingly. Change-Id: I040ed429b5aa7d391033fc6a540edbf07fc37827 BUG: 1214561 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/10288 Tested-by: Gluster Build System Reviewed-by: Venky Shankar Tested-by: NetBSD Build System --- xlators/mgmt/glusterd/src/glusterd-volume-set.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 919e0d445c6..9f751c90f3d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1655,11 +1655,16 @@ struct volopt_map_entry glusterd_volopt_map[] = { .value = BARRIER_TIMEOUT, .op_version = GD_OP_VERSION_3_6_0, }, + { .key = "changelog.capture-del-path", + .voltype = "features/changelog", + .type = NO_DOC, + .op_version = 3 + }, { .key = "features.barrier", .voltype = "features/barrier", .value = "disable", .type = NO_DOC, - .op_version = GD_OP_VERSION_3_6_0, + .op_version = GD_OP_VERSION_3_7_0, }, { .key = "features.barrier-timeout", .voltype = "features/barrier", -- cgit