diff options
| author | Venky Shankar <vshankar@redhat.com> | 2015-04-24 21:43:25 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-26 04:51:28 -0700 | 
| commit | 7be43338ff292eb9ff43892e05eb83575e66433c (patch) | |
| tree | 712259030e7e3baca62487116644f90931b26a36 | |
| parent | 652f5e8bd429ea0e2433e40ccee63ef1cd45baea (diff) | |
bitrot/scrub: fix induced throttling in syncop_ftw_throttle()
Failing to reset scanning counter causes "incorrect" delay of around
50 seconds per directory entry. This causes scrubber to run extremely
slowly.
[
    NOTE: This is a temporary fix. With the introduction of token
          bucket based throttling, inducing throttle via sleep()
          call would be unneeded.
]
Also, fix logging messages in scrubber to log brick and full path
of the object which is identified/marked as corrupted.
Change-Id: Id501bd15dcdbd8a09613f80f9d84050304740027
BUG: 1170075
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/10375
Tested-by: NetBSD Build System
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
| -rw-r--r-- | libglusterfs/src/syncop-utils.c | 4 | ||||
| -rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | 26 | 
2 files changed, 17 insertions, 13 deletions
diff --git a/libglusterfs/src/syncop-utils.c b/libglusterfs/src/syncop-utils.c index 2f3b50f18cd..349fa92d64f 100644 --- a/libglusterfs/src/syncop-utils.c +++ b/libglusterfs/src/syncop-utils.c @@ -187,8 +187,10 @@ syncop_ftw_throttle (xlator_t *subvol, loc_t *loc, int pid, void *data,                              !strcmp (entry->d_name, ".."))                                  continue; -                        if (++tmp >= count) +                        if (++tmp >= count) { +                                tmp = 0;                                  sleep (sleep_time); +                        }                          gf_link_inode_from_dirent (NULL, fd->inode, entry); diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c index 1e9c2035c81..ac45e6d9b6c 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c @@ -182,7 +182,7 @@ int  bitd_compare_ckum (xlator_t *this,                     br_isignature_out_t *sign,                     unsigned char *md, inode_t *linked_inode, -                   gf_dirent_t *entry, fd_t *fd, br_child_t *child) +                   gf_dirent_t *entry, fd_t *fd, br_child_t *child, loc_t *loc)  {          int   ret = -1;          dict_t *xattr = NULL; @@ -197,15 +197,15 @@ bitd_compare_ckum (xlator_t *this,          if (strncmp              (sign->signature, (char *) md, strlen (sign->signature)) == 0) { -                gf_log (this->name, GF_LOG_DEBUG, -                        "Entry %s [GFID: %s] matches calculated checksum", -                        entry->d_name, uuid_utoa (linked_inode->gfid)); +                gf_log (this->name, GF_LOG_DEBUG, "%s [GFID: %s | Brick: %s] " +                        "matches calculated checksum", loc->path, +                        uuid_utoa (linked_inode->gfid), child->brick_path);                  return 0;          }          gf_log (this->name, GF_LOG_WARNING, -                "Object checksumsum mismatch: %s [GFID: %s]", -                entry->d_name, uuid_utoa (linked_inode->gfid)); +                "Object checksumsum mismatch: %s [GFID: %s | Brick: %s]", +                loc->path, uuid_utoa (linked_inode->gfid), child->brick_path);          /* Perform bad-file marking */          xattr = dict_new (); @@ -217,18 +217,20 @@ bitd_compare_ckum (xlator_t *this,          ret = dict_set_int32 (xattr, "trusted.glusterfs.bad-file", _gf_true);          if (ret) {                  gf_log (this->name, GF_LOG_ERROR, -                        "Error setting bad-file marker for %s [GFID: %s]", -                        entry->d_name, uuid_utoa (linked_inode->gfid)); +                        "Error setting bad-file marker for %s [GFID: %s | " +                        "Brick: %s]", loc->path, uuid_utoa (linked_inode->gfid), +                        child->brick_path);                  goto dictfree;          } -        gf_log (this->name, GF_LOG_INFO, "Marking %s [GFID: %s] as corrupted..", -                entry->d_name, uuid_utoa (linked_inode->gfid)); +        gf_log (this->name, GF_LOG_INFO, "Marking %s [GFID: %s | Brick: %s] " +                "as corrupted..", loc->path, uuid_utoa (linked_inode->gfid), +                child->brick_path);          ret = syncop_fsetxattr (child->xl, fd, xattr, 0, NULL, NULL);          if (ret)                  gf_log (this->name, GF_LOG_ERROR,                          "Error marking object %s [GFID: %s] as corrupted", -                        entry->d_name, uuid_utoa (linked_inode->gfid)); +                        loc->path, uuid_utoa (linked_inode->gfid));   dictfree:          dict_unref (xattr); @@ -347,7 +349,7 @@ bitd_start_scrub (xlator_t *subvol,                  goto free_md;          ret = bitd_compare_ckum (this, sign, md, -                                 linked_inode, entry, fd, child); +                                 linked_inode, entry, fd, child, &loc);          GF_FREE (sign); /* alloced on post-compute */  | 
