-
Notifications
You must be signed in to change notification settings - Fork 795
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
Follow Plugin Optimizations OBO #1999
Comments
@mvandeberg how did this get merged to begin with? |
I did not review it as carefully as I should have and assumed it had been tested. |
|
The implementation for #1947 is incorrect.
Just before the while loop it is implied that it_l and it_u are not equal and both point to entries in the account's feed. This is wrong. I wrote a simple test that if the iterators don't both point to the same account, then log and my console was spammed.
I added the following directly before the while loop.
This could be logged on the first post for each account, but repeat authors were showing up, indicating a persistent problem. We had a node running
develop
crash due to a uniqueness constraint violation. I believe it is probably on the ordered unique index( account, blog_feed_id)
.The explanation is simple.
Lower Bound:
Returns an iterator pointing to the first element in the range [first,last) which does not compare less than val.
Upper Bound:
Returns an iterator pointing to the first element in the range [first,last) which compares greater than val.
It should be clear that upper bound will either return
rend()
or the next account. There is already a check that the iterators are not equal (which is trivially true assuming the index is non-empty). A quick decrement ofit_u
points it back to the account at the other end of the feed.I believe there is another problem when the account is first posting.
it_u
andit_l
point to a feed that does not belong to the account. The while loop will not enter and next_id for an feed that does not belong to the account will be returned. This is not as problematic but it means that feed ids do not necessarily start at 0.Due to the number of problems and apparent lack of testing, I am going to revert the merge of the original issue until these changes can be made and are properly tested. A simple test of user feeds and blogs against production should be sufficient to prove correctness.
The text was updated successfully, but these errors were encountered: