|
|
21ab4e |
From b25b822d2c3ec4b99a15a1d6d444d36f98bfab1c Mon Sep 17 00:00:00 2001
|
|
|
21ab4e |
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
21ab4e |
Date: Thu, 4 May 2017 20:56:43 +0530
|
|
|
21ab4e |
Subject: [PATCH 418/426] snapview-server : Refresh the snapshot list during
|
|
|
21ab4e |
each reconnect
|
|
|
21ab4e |
|
|
|
21ab4e |
Currently we are refreshing the snapshot list either when there is
|
|
|
21ab4e |
a request from glusterd or the very first initialization. But if
|
|
|
21ab4e |
anything changed after when glusterd is down then there is no
|
|
|
21ab4e |
mechanism to refresh the snashot dentries.
|
|
|
21ab4e |
|
|
|
21ab4e |
This patch will refresh snapshot list during each reconnect
|
|
|
21ab4e |
|
|
|
21ab4e |
Backport of>
|
|
|
21ab4e |
>Change-Id: I3ed655572d777f60d57dd479d190f75553591267
|
|
|
21ab4e |
>BUG: 1448150
|
|
|
21ab4e |
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
21ab4e |
>Reviewed-on: https://review.gluster.org/17178
|
|
|
21ab4e |
>Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>Reviewed-by: Amar Tumballi <amarts@redhat.com>
|
|
|
21ab4e |
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
21ab4e |
>Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
|
|
|
21ab4e |
|
|
|
21ab4e |
Change-Id: I3ed655572d777f60d57dd479d190f75553591267
|
|
|
21ab4e |
BUG: 1165648
|
|
|
21ab4e |
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
21ab4e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/105517
|
|
|
21ab4e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
21ab4e |
---
|
|
|
21ab4e |
.../snapview-server/src/snapview-server-mgmt.c | 32 ++++++++++++++++++++++
|
|
|
21ab4e |
.../mgmt/glusterd/src/glusterd-snapshot-utils.c | 1 +
|
|
|
21ab4e |
2 files changed, 33 insertions(+)
|
|
|
21ab4e |
|
|
|
21ab4e |
diff --git a/xlators/features/snapview-server/src/snapview-server-mgmt.c b/xlators/features/snapview-server/src/snapview-server-mgmt.c
|
|
|
21ab4e |
index fc2ff2a..18c902d 100644
|
|
|
21ab4e |
--- a/xlators/features/snapview-server/src/snapview-server-mgmt.c
|
|
|
21ab4e |
+++ b/xlators/features/snapview-server/src/snapview-server-mgmt.c
|
|
|
21ab4e |
@@ -49,6 +49,31 @@ rpc_clnt_prog_t svs_clnt_handshake_prog = {
|
|
|
21ab4e |
.procnames = clnt_handshake_procs,
|
|
|
21ab4e |
};
|
|
|
21ab4e |
|
|
|
21ab4e |
+static int
|
|
|
21ab4e |
+svs_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
21ab4e |
+ void *data)
|
|
|
21ab4e |
+{
|
|
|
21ab4e |
+ xlator_t *this = NULL;
|
|
|
21ab4e |
+ int ret = 0;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ this = mydata;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ switch (event) {
|
|
|
21ab4e |
+ case RPC_CLNT_CONNECT:
|
|
|
21ab4e |
+ ret = svs_get_snapshot_list (this);
|
|
|
21ab4e |
+ if (ret) {
|
|
|
21ab4e |
+ gf_log (this->name, GF_LOG_ERROR,
|
|
|
21ab4e |
+ "Error in refreshing the snaplist "
|
|
|
21ab4e |
+ "infrastructure");
|
|
|
21ab4e |
+ ret = -1;
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+ break;
|
|
|
21ab4e |
+ default:
|
|
|
21ab4e |
+ break;
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+ return ret;
|
|
|
21ab4e |
+}
|
|
|
21ab4e |
+
|
|
|
21ab4e |
int
|
|
|
21ab4e |
svs_mgmt_init (xlator_t *this)
|
|
|
21ab4e |
{
|
|
|
21ab4e |
@@ -86,6 +111,13 @@ svs_mgmt_init (xlator_t *this)
|
|
|
21ab4e |
goto out;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
|
|
|
21ab4e |
+ ret = rpc_clnt_register_notify (priv->rpc, svs_rpc_notify, this);
|
|
|
21ab4e |
+ if (ret) {
|
|
|
21ab4e |
+ gf_log (this->name, GF_LOG_WARNING,
|
|
|
21ab4e |
+ "failed to register notify function");
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+
|
|
|
21ab4e |
ret = rpcclnt_cbk_program_register (priv->rpc, &svs_cbk_prog,
|
|
|
21ab4e |
this);
|
|
|
21ab4e |
if (ret) {
|
|
|
21ab4e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
|
|
21ab4e |
index c4cfc84..e833cc9 100644
|
|
|
21ab4e |
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
|
|
21ab4e |
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
|
|
21ab4e |
@@ -1705,6 +1705,7 @@ glusterd_import_friend_snap (dict_t *peer_data, int32_t snap_count,
|
|
|
21ab4e |
"object %s", peer_snap_name);
|
|
|
21ab4e |
goto out;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
+ glusterd_fetchsnap_notify (this);
|
|
|
21ab4e |
|
|
|
21ab4e |
out:
|
|
|
21ab4e |
if (ret)
|
|
|
21ab4e |
--
|
|
|
21ab4e |
1.8.3.1
|
|
|
21ab4e |
|