Skip to content

Fix index iterator#565

Merged
sanderpick merged 3 commits intomasterfrom
sander/fix-iterator
Oct 29, 2021
Merged

Fix index iterator#565
sanderpick merged 3 commits intomasterfrom
sander/fix-iterator

Conversation

@sanderpick
Copy link
Copy Markdown
Contributor

  • 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
Copy Markdown
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
Copy Markdown
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