summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/src/changelog-helpers.h
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2014-02-19 20:47:46 +0530
committerVenky Shankar <vshankar@redhat.com>2014-05-14 05:10:15 -0700
commitd2db585ce7e26851178104433fa9422482d8719e (patch)
tree2e52f15cf261906debd8ec54106ffe9f84af881e /xlators/features/changelog/src/changelog-helpers.h
parentbfde478cedda8267134ee3807c8db5e042115eae (diff)
features/changelog : historical journal consumption.
Facilitates Glusterfs with the ability to detect file-operations happened in past by scanning the back-end(brick-level) glusterfs journal (changelog). Design: * List of changelogs produces in one perfectly running session are stored in htime file which also holds necessary information about the session start and end time. * Involves fixed sized seeks to identify N'th changelog in the list. * Requires O(log n), (where n is number of changelogs in the list), time to identify the end changelog for the given start-end time interval. Currently the background processing of changelogs is sub optimal. BZ 1097041 tracks the development effort. For complete design, refer the below link: http://lists.nongnu.org/archive/html/gluster-devel/2014-02/msg00206.html Change-Id: I27e49f75e492e843084d0ecaf9130224d08462a0 BUG: 1091961 Signed-off-by: Ajeet Jha <ajha@redhat.com> Signed-off-by: Venky Shankar <vshankar@redhat.com> Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/6930 Reviewed-by: Kotresh HR <khiremat@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/changelog/src/changelog-helpers.h')
-rw-r--r--xlators/features/changelog/src/changelog-helpers.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h
index ec90f8a13d7..987af190b9c 100644
--- a/xlators/features/changelog/src/changelog-helpers.h
+++ b/xlators/features/changelog/src/changelog-helpers.h
@@ -203,9 +203,18 @@ struct changelog_priv {
/* logging directory */
char *changelog_dir;
+ /* htime directory */
+ char *htime_dir;
+
/* one file for all changelog types */
int changelog_fd;
+ /* htime fd for current changelog session */
+ int htime_fd;
+
+ /* rollover_count used by htime */
+ int rollover_count;
+
gf_lock_t lock;
/* writen end of the pipe */
@@ -393,6 +402,11 @@ void *
changelog_fsync_thread (void *data);
int
changelog_forget (xlator_t *this, inode_t *inode);
+int
+htime_update (xlator_t *this, changelog_priv_t *priv,
+ unsigned long ts, char * buffer);
+int
+htime_open (xlator_t *this, changelog_priv_t * priv, unsigned long ts);
/* Geo-Rep snapshot dependency changes */
void
@@ -549,5 +563,6 @@ call_stub_t *__chlog_barrier_dequeue (xlator_t *this, struct list_head *queue);
goto label; \
} \
} while (0)
+/* End: Geo-Rep snapshot dependency changes */
+
#endif /* _CHANGELOG_HELPERS_H */
-/* End: Geo-Rep snapshot dependency changes */