You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zookeeper version: 3.4.6
this problem description: If you use the zk store lib, you will find that when the same node repeatedly goes online and offline, the node can no longer be discovery. After the investigation, it is found that the node path exists in zk, but the data cannot be obtained and the data is empty.
Previous code:store/zookeeper/zookeeper.go line 68.
func (s*Zookeeper) Get(keystring) (pair*store.KVPair, errerror) {
resp, meta, err:=s.client.Get(s.normalize(key))
iferr!=nil {
iferr==zk.ErrNoNode {
returnnil, store.ErrKeyNotFound
}
returnnil, err
}
// FIXME handle very rare cases where Get returns the// SOH control character instead of the actual valueifstring(resp) ==SOH {
returns.Get(store.Normalize(key))
}
pair=&store.KVPair{
Key: key,
Value: resp,
LastIndex: uint64(meta.Version),
}
returnpair, nil
}
Modified code, the problem disappears, hope to adopt.
func (s*Zookeeper) Get(keystring) (pair*store.KVPair, errerror) {
resp, meta, err:=s.client.Get(s.normalize(key))
iferr!=nil {
iferr==zk.ErrNoNode {
returnnil, store.ErrKeyNotFound
}
returnnil, err
}
// FIXME handle very rare cases where Get returns the// SOH control character instead of the actual valueifstring(resp) ==SOH||string(resp) =="" { //If the data is empty, you can get it again.returns.Get(key) //get by original key
}
pair=&store.KVPair{
Key: key,
Value: resp,
LastIndex: uint64(meta.Version),
}
returnpair, nil
}
The text was updated successfully, but these errors were encountered:
zookeeper version: 3.4.6
this problem description: If you use the zk store lib, you will find that when the same node repeatedly goes online and offline, the node can no longer be discovery. After the investigation, it is found that the node path exists in zk, but the data cannot be obtained and the data is empty.
Previous code:store/zookeeper/zookeeper.go line 68.
Modified code, the problem disappears, hope to adopt.
The text was updated successfully, but these errors were encountered: