summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-01-28 05:55:58 -0800
committerGerrit Code Review <review@dev.gluster.org>2014-01-28 05:55:58 -0800
commitb66f359fda0b43563e43e1a299542f088337846a (patch)
treed1b35c6c362d13a87d91123f7a58a5d030e94717 /xlators/features
parent738e76f0799fa598eac308144174c6cf9db21b7a (diff)
parent306f29a8f49dc7358e195cd0a80531776ff679f7 (diff)
Merge "NSR reconciliation: Adding index for each op"
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/changelog/src/policy/changelog-policy-replication.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/features/changelog/src/policy/changelog-policy-replication.c b/xlators/features/changelog/src/policy/changelog-policy-replication.c
index 2c54d2c..5c6fca4 100644
--- a/xlators/features/changelog/src/policy/changelog-policy-replication.c
+++ b/xlators/features/changelog/src/policy/changelog-policy-replication.c
@@ -112,6 +112,7 @@ uuid_fn (void *data, char *buffer, gf_boolean_t encode)
/* TBD: move declarations here and nsr.c into a common place */
#define NSR_TERM_XATTR "trusted.nsr.term"
+#define NSR_INDEX_XATTR "trusted.nsr.index"
#define RECON_TERM_XATTR "trusted.nsr.recon-term"
#define RECON_INDEX_XATTR "trusted.nsr.recon-index"
@@ -121,6 +122,7 @@ changelog_fix_term(xlator_t *this,
dict_t *xdata)
{
int32_t old_term, new_term;
+ uint32_t index;
changelog_priv_t *priv = this->private;
int ret = 0;
char nfile[PATH_MAX] = {0,};
@@ -130,7 +132,8 @@ changelog_fix_term(xlator_t *this,
// If coming via the regular IO path, we should get the dict "nsr-term"
// If coming via reconciliation, we should get the dicts "nsr-recon-term"
// that indicates the term and "nsr-recon-index" for the index
- if (dict_get_int32(xdata,NSR_TERM_XATTR,&new_term) == 0) {
+ if ((dict_get_int32(xdata,NSR_TERM_XATTR,&new_term) == 0) &&
+ (dict_get_int32(xdata, NSR_INDEX_XATTR, &index) == 0)) {
old_term = priv->term;
if (old_term != new_term) {
@@ -147,7 +150,7 @@ changelog_fix_term(xlator_t *this,
return _gf_false;
}
local->nr_bytes = 0;
- local->lu.val = get_index (priv);
+ local->lu.val = index;
} else if ((dict_get_int32(xdata, RECON_TERM_XATTR, &recon_term) == 0) &&
(dict_get_int32(xdata, RECON_INDEX_XATTR, &recon_index) == 0)) {