You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2020/09/24 15:34:13 UTC

[GitHub] [celix] unitink72 commented on pull request #285: Add API call for retrieving db index

unitink72 commented on pull request #285:
URL: https://github.com/apache/celix/pull/285#issuecomment-698421443


   I had two factors that led me to wanting this available:
   1. When I wrote my db interface code, the first thing I did was setup a directory/key structure then set a watch on the etcd directory containing all those keys.  Using the index from the last get always resulted in the watch api being triggered on changes that were made in the past.  There was an ugly work around that by writing a key that was outside that dir structure then reading it again, but that was a hack.
   
   2. In the link you gave (etcd v2 api), there's a section down further titled "Watch From Cleared Event Index".   It describes a case that could happen in my system - the modified index of the key being over 1000 revisions old.  This would break my watch api calls.
   
   It may be possible to have multiple X-Etcd-Index values among a cluster, but I'm assuming that they try to sycn them up asap.  That issue doesn't bother me for my system.
   
   If the code doesnt fit for your project, thats OK.  Just thought I'd offer it up as its definitely useful for me.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org