diff options
Diffstat (limited to 'xlators/features/changelog/src/policy/changelog-policy-replication.c')
-rw-r--r-- | xlators/features/changelog/src/policy/changelog-policy-replication.c | 7 |
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 2c54d2cff..5c6fca4e0 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)) { |