I have an application that needs to watch a service directory for any membership changes.
When I start the application, I first read the directory to get the current state.
Now I initiate a Watch on the directory, with the watch index set to dirNode.ModifiedIndex + 1.
However, if I restart the application after some time (of the order of an hour), I get the following error from
the Watch routine:
Err: 401: The event in requested index is outdated and cleared (the requested history has been cleared [19629/11965]) [20628]"curl
http://127.0.0.1:2379/v2/keys/contiv.io/service/netmaster{"action":"get","node":{"key":"/
contiv.io/service/netmaster","dir":true,"nodes":[{"key":"/
contiv.io/service/netmaster/k8master:9999","value":"{\"ServiceName\":\"netmaster\",\"HostAddr\":\"k8master\",\"Port\":9999}","expiration":"2016-01-31T03:18:49.736189948Z","ttl":41,"modifiedIndex":22040,"createdIndex":11964}],"
modifiedIndex":11964,"createdIndex":11964}}
Why am I getting this error? Am I supposed to pass a different watch index?
Any ideas/suggestions appreciated.
Thanks,
Joji.