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

Fix index iterator #565

Merged
merged 3 commits into from
Oct 29, 2021
Merged

Fix index iterator #565

merged 3 commits into from
Oct 29, 2021

Conversation

sanderpick
Copy link
Member

  • Fixes index iterator panic
  • Adds a flag to skip thread head migration that can be used when we know migration is not needed, as in, it's already been run. This should greatly reduce the time to deploy.
  • I started updating libp2p to 0.15.1, which requires an update to go-datastore. Those changes require we wire context into all the datastore apis we use (keystore, logstore, db). I pushed that wip work to https://github.com/textileio/go-threads/tree/sander/libp2p-0.15.1. I think going down that path means a major version bump because the external DB apis would need to take context. Paused for now.

Signed-off-by: Sander Pick <sanderpick@gmail.com>
Signed-off-by: Sander Pick <sanderpick@gmail.com>
Signed-off-by: Sander Pick <sanderpick@gmail.com>
iter, err := newIterator(txn, t.collection.baseKey(), q)
if err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! alternative if iterator needs to be instantiated everywhere we can make iterator methods always check for a nil value before doing stuff, but as it's used in only one place, this Go idiom is much simpler!

Copy link
Contributor

@merlinran merlinran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sanderpick sanderpick merged commit 3479a19 into master Oct 29, 2021
@sanderpick sanderpick deleted the sander/fix-iterator branch October 29, 2021 15:51
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.

2 participants