diff options
author | Avra Sengupta <asengupt@redhat.com> | 2014-04-22 00:52:57 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-04-28 04:02:22 -0700 |
commit | 54a5a42848870ee17b923c6c37d65fdfe4a5fec9 (patch) | |
tree | f3203513924efaa7c28b2419611729356cc9066e /rpc/rpc-lib/src | |
parent | a7c8d514c0487019d218c327deb52f7d09645875 (diff) |
glusterd/snapshot: Compare and update snapshots during peer handshake
During a peer-handshake, after the volumes have synced, and the list of
missed snapshots have synced, the node will perform the pending deletes
and restores on this list. At this point, the current snapshot list in
the node will be updated, and hence in case of conflicts arising during
snapshot handshake, the peer hosting the bricks will be given precedence
Likewise, if there will be a conflict, and both peers will be in the same
state, i.e either both would be hosting bricks or both would not be hosting
bricks, then a decision can't be taken and a peer-reject will happen.
glusterd_compare_and_update_snap() implements the following algorithm to
perform the above task:
Step 1: Start.
Step 2: Check if the peer is missing a delete on the said snap.
If yes, goto step 6.
Step 3: Check if there is a conflict between the peer's data and the
local snap. If no, goto step 5.
Step 4: As there is a conflict, check if both the peer and the local nodes
are hosting bricks. Based on the results perform the following:
Peer Hosts Bricks Local Node Hosts Bricks Action
Yes Yes Goto Step 7
No No Goto Step 7
Yes No Goto Step 8
No Yes Goto Step 6
Step 5: Check if the local node is missing the peer's data.
If yes, goto step 9.
Step 6: It's a no-op. Goto step 10
Step 7: Peer Reject. Goto step 10
Step 8: Delete local node's data.
Step 9: Accept Peer Data.
Step 10: Stop
Change-Id: I79be0f0f5f2a4f5c72277a4e77c2be732af432e1
BUG: 1061685
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7525
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src')
-rw-r--r-- | rpc/rpc-lib/src/protocol-common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h index 8129b8131d2..e4f7fbf3ad8 100644 --- a/rpc/rpc-lib/src/protocol-common.h +++ b/rpc/rpc-lib/src/protocol-common.h @@ -109,6 +109,7 @@ enum gf_probe_resp { GF_PROBE_ADD_FAILED, GF_PROBE_QUORUM_NOT_MET, GF_PROBE_MISSED_SNAP_CONFLICT, + GF_PROBE_SNAP_CONFLICT, }; enum gf_deprobe_resp { |