Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#1307) Detect failure to progress changes to update_seq #1352

Closed
wants to merge 1 commit into from

Conversation

ig3
Copy link

@ig3 ig3 commented Feb 10, 2014

This change breaks the infinite loop noted in issue #1307

@daleharvey
Copy link
Member

I wanna take a bit more of a look into this, I think its a faulty assumption that last_seq should progress to update_seq and its a case we shouldnt fail in (and definitely not infinitely repeat)

@daleharvey
Copy link
Member

@rnewson might be able to give a bit more info, I specifically remember dealing with an issue previously where security object updates would update the update_seq but not the last_seq, or similiar

@rnewson
Copy link

rnewson commented Feb 10, 2014

yeah, I had a similar bug in couchdb-lucene (in fact, I'm not even sure I fixed it yet!). To ensure you are up to date, you must read _changes?since=SINCE until you reach the end of the feed. Then you are up to date. For couchdb, it'll == update_seq, but bigcouch/cloudant/a.n.other, not necessarily.

@rnewson
Copy link

rnewson commented Feb 10, 2014

and, yes, updating the _security object will bump update_seq without adding items to the _changes feed. I forget if purges also bump update_seq (in addition to purge_seq) but I'm pretty sure there are other changes that bump update_seq without adding an item to _changes.

@ig3
Copy link
Author

ig3 commented Feb 10, 2014

This is a bad change otherwise too. I messed up whitespace and didn't re-test after rebase. It is failing a test now. Given the issues noted above, I don't know enough to write a generally correct fix to the infinite loop.

@ig3
Copy link
Author

ig3 commented Feb 10, 2014

Maybe this is news only to me, but COUCHDB-1367 describes some issues and options around changes, last_seq and update_seq.

One of my assumptions was that a call to _changes that returned no changes indicates that there are no more changes at the time of the request. Is this valid? Similarly, if limit is given and fewer than limit changes are returned, does this mean there were no more at the time the request was processed? My understanding is that without limit, all changes since 'since' will be returned - whatever set that is, that's all the changes there are. But maybe I misunderstood that too.

Anyway, my apologies if this is just noise. I'll be quiet now, but let me know if I can help somehow.

@ig3
Copy link
Author

ig3 commented Feb 10, 2014

This wasn't a good way to go...

@ig3 ig3 closed this Feb 10, 2014
daleharvey added a commit that referenced this pull request Feb 23, 2014
daleharvey added a commit that referenced this pull request Feb 23, 2014
daleharvey added a commit that referenced this pull request Feb 23, 2014
daleharvey added a commit that referenced this pull request Feb 23, 2014
daleharvey added a commit that referenced this pull request Mar 8, 2014
(#1352) - Remove allDbs
sygi pushed a commit to sygi/pouchdb that referenced this pull request Apr 28, 2014
sygi pushed a commit to sygi/pouchdb that referenced this pull request Apr 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants