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