summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2016-02-08 13:30:49 -0500
committerJeff Darcy <jdarcy@redhat.com>2016-02-13 05:13:07 -0800
commitc458433041aafb48ae6d6e5fcf3e1e737dc3fda3 (patch)
tree33a03ca0c1f5faf58419de2c4ff4532752ddfb07 /glusterfsd
parentda33097c3d6492e3b468b4347e47c70828fb4320 (diff)
experimental: add fdl (Full Data Logging) translator
NSR needs logging that is different than our existing changelog in several ways: * Full data, not just metadata * Pre-op, not post-op * High performance * Supports the concept of time-bounded "terms" Others (for example EC) might need the same thing. This patch adds such a translator. It also adds code to dump the resulting journals, and to replay them using syncops, plus (very rudimentary) tests for all of the above. Change-Id: I29680a1b4e0a9e7d5a8497fef302c46434b86636 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/12450 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index bbaca1e7277..c980e7bc640 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1199,6 +1199,26 @@ parse_opts (int key, char *arg, struct argp_state *state)
return 0;
}
+gf_boolean_t
+should_call_fini (glusterfs_ctx_t *ctx, xlator_t *trav)
+{
+ /* There's nothing to call, so the other checks don't matter. */
+ if (!trav->fini) {
+ return _gf_false;
+ }
+
+ /* This preserves previous behavior in glusterd. */
+ if (ctx->process_mode == GF_GLUSTERD_PROCESS) {
+ return _gf_true;
+ }
+
+ /* This is the only one known to be safe in glusterfsd. */
+ if (!strcmp(trav->type,"experimental/fdl")) {
+ return _gf_true;
+ }
+
+ return _gf_false;
+}
void
cleanup_and_exit (int signum)
@@ -1271,20 +1291,17 @@ cleanup_and_exit (int signum)
/*call fini for glusterd xlator */
/* TODO : Invoke fini for rest of the xlators */
- if (ctx->process_mode == GF_GLUSTERD_PROCESS) {
-
- trav = NULL;
- if (ctx->active)
- trav = ctx->active->top;
- while (trav) {
- if (trav->fini) {
- THIS = trav;
- trav->fini (trav);
- }
- trav = trav->next;
+ trav = NULL;
+ if (ctx->active)
+ trav = ctx->active->top;
+ while (trav) {
+ if (should_call_fini(ctx,trav)) {
+ THIS = trav;
+ trav->fini (trav);
}
-
+ trav = trav->next;
}
+
exit(0);
}