diff options
author | Amar Tumballi <amar@gluster.com> | 2011-03-30 00:03:20 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-04-06 10:50:22 -0700 |
commit | 99af7219c54b2264ede898fa619125c629519174 (patch) | |
tree | f846f87964b7dd19de5188ad9e0d74b810e83507 /xlators/cluster/dht | |
parent | a1a0e929534cb56e3a938229c7f87bfd0f1c17ec (diff) |
log gfid mismatches for the same file in cluster xlator lookup
This can help in pin pointing some of the issues resulted in gfid
mismatch for the same file, which is harder to find through basic
debugging/logging of current codebase.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@gluster.com>
BUG: 2346 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 0220d5e59e0..10f61cca005 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -170,6 +170,13 @@ dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (!op_ret && uuid_is_null (local->gfid)) memcpy (local->gfid, stbuf->ia_gfid, 16); + /* Check if the gfid is different for file from other node */ + if (!op_ret && uuid_compare (local->gfid, stbuf->ia_gfid)) { + gf_log (this->name, GF_LOG_WARNING, + "%s: gfid different on %s", + local->loc.path, prev->this->name); + } + LOCK (&frame->lock); { /* TODO: assert equal mode on stbuf->st_mode and @@ -662,6 +669,12 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (uuid_is_null (local->gfid)) memcpy (local->gfid, buf->ia_gfid, 16); + if (uuid_compare (local->gfid, buf->ia_gfid)) { + gf_log (this->name, GF_LOG_WARNING, + "%s: gfid differs on subvolume %s", + loc->path, prev->this->name); + } + is_linkfile = check_is_linkfile (inode, buf, xattr); is_dir = check_is_dir (inode, buf, xattr); @@ -873,6 +886,12 @@ dht_lookup_linkfile_cbk (call_frame_t *frame, void *cookie, goto err; } + if (uuid_compare (local->gfid, stbuf->ia_gfid)) { + gf_log (this->name, GF_LOG_WARNING, + "%s: gfid different on data file on %s", + local->loc.path, subvol->name); + } + if ((stbuf->ia_nlink == 1) && (conf && conf->unhashed_sticky_bit)) { stbuf->ia_prot.sticky = 1; @@ -977,7 +996,7 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* This is required for handling stale linkfile deletion, * or any more call which happens from this 'loc'. */ - if (uuid_is_null (local->gfid) && !op_ret) + if (!op_ret && uuid_is_null (local->gfid)) memcpy (local->gfid, stbuf->ia_gfid, 16); if (ENTRY_MISSING (op_ret, op_errno)) { |