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

[DEMO: don't merge] Trial kvstore interface cleanup #836

Closed
wants to merge 4 commits into from

Conversation

ethanfrey
Copy link
Contributor

Closes #823

Modify the interfaces as discussed in issue. And update ./store to use the new interface.

All other code, like Buckets, is not updated yet. Waiting for feedback if to continue with this or change course

@ethanfrey ethanfrey requested a review from husio June 27, 2019 21:45
@iov-bot-danger
Copy link

1 Error
🚫 Please include a CHANGELOG entry.
You can find it at CHANGELOG.md.

Generated by 🚫 Danger

Copy link
Contributor

@husio husio left a comment

Choose a reason for hiding this comment

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

I think this is a good change. Makes even more sense when we merge #835

All database methods are accepting context, but I don't think they fully support it as they do not check the cancellation status. Usually the database driver should do this work. In our case the database is not context aware.

Should we add at the beginning of each or the core methods check if the context was cancelled?

switch {
case <-ctx.Done():
    return nil, ctx.Err()
default:
    // Context not cancelled, proceed.
}

@ethanfrey
Copy link
Contributor Author

All database methods are accepting context, but I don't think they fully support it as they do not check the cancellation status. Usually the database driver should do this work. In our case the database is not context aware.

This makes sense. I think there is no cancel in iavl, except for the long-running processes, which we do handle with a context. That said, I like your idea of manually checking cancel in the beginning, so it does have some effect (even if it doesn't abort in middle of the I/O, it will break out long-running processes, like with a timeout)

@ruseinov
Copy link
Contributor

ruseinov commented Jul 4, 2019

Change seems good to me, and it would indeed be cool to have methods exit on context cancellation, effectively making them a noop if they were just called.

@husio
Copy link
Contributor

husio commented Jul 19, 2019

I would love to merge this. There are a lot of conflicts by now. I can resolve all conflicts and bring the code to mergable state.
Do we want to apply this change? If yes, I can take care of finishing this pull request.

@ruseinov
Copy link
Contributor

It does not seem like a good idea to do merge this now as we have decided to hold off on any interface breaking changes that touch multiple packages.

We either have to give up on the idea of keeping master launch-compatible, which in my opinion is an okay approach, or keep this open till we have a way forward.

To make this decision we'll need to have some direction from business.

@ethanfrey ethanfrey changed the title Trial kvstore interface cleanup [DEMO: don't merge] Trial kvstore interface cleanup Jul 29, 2019
@ethanfrey
Copy link
Contributor Author

I think this should be done as a post-launch overhaul. It changes code, but doesn't break any external guarantees (how blockchain txs execute). So easy enough to add in an iov chain upgrade, say 1.0 -> 1.1

@kmw101 kmw101 closed this Aug 7, 2019
@husio husio deleted the spike-kvstore branch November 13, 2019 11:50
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.

Clean up store interface
5 participants