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

Use bbolt as snapshot store #9

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

wraymo
Copy link

@wraymo wraymo commented Apr 26, 2022

This PR is based on #7. Try to implement bbolt snapshot instead of file snapshot.

@casbin-bot
Copy link
Member

@tangyang9464 @closetool @sagilio please review

@CLAassistant
Copy link

CLAassistant commented Apr 26, 2022

CLA assistant check
All committers have signed the CLA.

@wraymo wraymo changed the title Use bblotBolt snapshot Use bblot as snapshot store Apr 26, 2022
@wraymo wraymo changed the title Use bblot as snapshot store Use bbolt as snapshot store Apr 26, 2022
store/boltstore/bolt_store.go Show resolved Hide resolved
store/boltstore/bolt_store.go Show resolved Hide resolved
store/boltstore/bolt_store.go Show resolved Hide resolved
store/boltstore/bolt_store.go Outdated Show resolved Hide resolved
store/boltstore/bolt_store.go Outdated Show resolved Hide resolved
store/boltstore/bolt_store_test.go Show resolved Hide resolved
@wraymo
Copy link
Author

wraymo commented Apr 30, 2022

Updated the changes. Please take a look

Copy link
Member

@nodece nodece left a comment

Choose a reason for hiding this comment

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

Good work!

@nodece
Copy link
Member

nodece commented May 1, 2022

Currently, we are using the file snapshot store, if we switch the bbolt as snapshot store, maybe this breaks user data, do you have idea to improve this?

@wraymo
Copy link
Author

wraymo commented May 1, 2022

Currently, we are using the file snapshot store, if we switch the bbolt as snapshot store, maybe this breaks user data, do you have idea to improve this?

I'm not sure whether we can simply migrate file snapshots to bbolt, that is to read file snapshots and put key-value pairs into bbolt.

@nodece
Copy link
Member

nodece commented May 2, 2022

This is a good idea, I think we can add a flag here, default to file snapshot, if the user switches the bbolt snapshot, we need to check whether the file snapshot exists, if true, we need to migrate the file snapshot to bbolt snapshot.

@wraymo
Copy link
Author

wraymo commented May 2, 2022

This is a good idea, I think we can add a flag here, default to file snapshot, if the user switches the bbolt snapshot, we need to check whether the file snapshot exists, if true, we need to migrate the file snapshot to bbolt snapshot.

I just added relevant code.

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.

4 participants