Details
-
Bug
-
Resolution: Fixed
-
Critical
-
7.0.2, 7.0.3, 7.1.0
-
Untriaged
-
1
-
Yes
-
KV March-22
Description
To reproduce
- Setup 6.6.5 node
- Rebalance in >= 7.0.2 node
- Bootstrap memcached connection and try to get cluster config from the upgraded node
- The get fails with status 1 (key not found)
from mc_bin_client import MemcachedClient |
client = MemcachedClient("127.0.0.1", 12000) |
client.hello("") |
client.sasl_auth_plain("Administrator", "password") |
client.bucket_select("default") |
_, _, config = client._doCmd(0xb5, '', '') |
This issue was introduced in 7.0.2 when introducing MB-46363
The issue is that ns_server sends a -1 epoch when cluster compat is < 7.0. When kv_engine handles the get cluster config here, maybeGetConfiguration checks if the passed in version is less than the active version here. If so, it returns a config. It was assumed that supplying 0s for this arg would always return true however the introduction of -1 broke this assumption.
This code compares the actual epoch (-1) with the default epoch (0) and 0 is not less than -1 so no config is returned which ultimately returns an empty unique_ptr which fails the if branch here and returns KeyEnoent
This diff fixed the issue for me although the fix probably needs to be more robust
diff --git a/daemon/cluster_config.h b/daemon/cluster_config.h
|
index 8b0cf70bb..d8cd302a7 100644
|
--- a/daemon/cluster_config.h
|
+++ b/daemon/cluster_config.h
|
@@ -27,14 +27,14 @@ public:
|
: epoch(epoch), revno(revno){};
|
|
bool operator==(const ClustermapVersion& other) const {
|
- return epoch == other.epoch && revno == other.revno;
|
+ return (other.epoch == -1 || epoch == other.epoch) && revno == other.revno;
|
}
|
|
bool operator<(const ClustermapVersion& other) const {
|
if (epoch < other.epoch) {
|
return true;
|
}
|
- if (epoch == other.epoch) {
|
+ if (other.epoch == -1 || epoch == other.epoch) {
|
return revno < other.revno;
|
}
|
return false; |
Attachments
Issue Links
- relates to
-
NCBC-3175 Get cluster config fails with DocumentNotFound in mixed mode (>= 7.0.2)
-
- Resolved
-
For Gerrit Dashboard: MB-51612 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
172962,3 | MB-51612: Ensure GetClusterConfig/NMVB sends config in mixed clusters | cheshire-cat | kv_engine | Status: MERGED | +2 | +1 |
173945,1 | Merge branch 'couchbase/cheshire-cat' into neo | neo | kv_engine | Status: ABANDONED | 0 | -1 |
173958,3 | MB-51612: Merge 'couchbase/cheshire-cat' into neo | neo | kv_engine | Status: ABANDONED | 0 | 0 |
173960,2 | MB-51648: Forward merge (chechire-cat) 7.0.4 to (neo) 7.1.1 | neo | kv_engine | Status: MERGED | +2 | +1 |
173963,1 | MB-51612: Forward merge to neo | neo | kv_engine | Status: ABANDONED | 0 | +1 |
174030,1 | Forward merge neo to master | master | kv_engine | Status: MERGED | +2 | +1 |