From 7927e8747c731dbb105e93ae66c336338f48f0e6 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Sun, 15 Feb 2015 15:05:19 +0530 Subject: features/bit-rot: Implementation of bit-rot xlator This is the "Signer" -- responsible for signing files with their checksums upon last file descriptor close (last release()). The event notification facility provided by the changelog xlator is made use of. Moreover, checksums are as of now SHA256 hash of the object data and is the only available hash at this point of time. Therefore, there is no special "what hash to use" type check, although it's does not take much to add various hashing algorithms to sign objects with. Signatures are stored in extended attributes of the objects along with the the type of hashing used to calculate the signature. This makes thing future proof when other hash types are added. The signature infrastructure is provided by bitrot stub: a little piece of code that sits over the POSIX xlator providing interfaces to "get or set" objects signature and it's staleness. Since objects are signed upon receiving release() notification, pre-existing data which are "never" modified would never be signed. To counter this, an initial crawler thread is spawned The crawler scans the entire brick for objects that are unsigned or "missed" signing due to the server going offline (node reboots, crashes, etc..) and triggers an explicit sign. This would also sign objects when bit-rot is enabled for a volume and/or after upgrade. Change-Id: I1d9a98bee6cad1c39c35c53c8fb0fc4bad2bf67b BUG: 1170075 Original-Author: Raghavendra Bhat Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/9711 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/syncop-utils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libglusterfs/src/syncop-utils.h') diff --git a/libglusterfs/src/syncop-utils.h b/libglusterfs/src/syncop-utils.h index 918b3b7c666..7a9ccacb285 100644 --- a/libglusterfs/src/syncop-utils.h +++ b/libglusterfs/src/syncop-utils.h @@ -30,4 +30,10 @@ syncop_is_subvol_local (xlator_t *this, loc_t *loc, gf_boolean_t *is_local); int syncop_gfid_to_path (inode_table_t *itable, xlator_t *subvol, uuid_t gfid, char **path_p); + +int +syncop_ftw_throttle (xlator_t *subvol, loc_t *loc, int pid, void *data, + int (*fn) (xlator_t *subvol, gf_dirent_t *entry, + loc_t *parent, void *data), + int count, int sleep_time); #endif /* _SYNCOP_H */ -- cgit