-
Notifications
You must be signed in to change notification settings - Fork 4
Add LeaderScheduleEntry #12
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
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
6f640ad to
2c86c5a
Compare
superzordon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small refactors for code understandability and cleanliness, but otherwise looks good to me!
entries/pkid.go
Outdated
|
|
||
| // Transform the entries into a list of keys to delete. | ||
| keysToDelete := consumer.KeysToDelete(uniqueEntries) | ||
| keysToDelete = consumer.FilterKeysByPrefix(keysToDelete, lib.Prefixes.PrefixSnapshotLeaderSchedule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| keysToDelete = consumer.FilterKeysByPrefix(keysToDelete, lib.Prefixes.PrefixSnapshotLeaderSchedule) | |
| leaderSchedKeysToDelete := consumer.FilterKeysByPrefix(keysToDelete, lib.Prefixes.PrefixSnapshotLeaderSchedule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make it easier in the future to understand how to add support for a different prefix type
entries/pkid.go
Outdated
| // Execute the delete query. | ||
| if _, err := db.NewDelete(). | ||
| Model(&LeaderScheduleEntry{}). | ||
| Where("badger_key IN (?)", bun.In(keysToDelete)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Where("badger_key IN (?)", bun.In(keysToDelete)). | |
| Where("badger_key IN (?)", bun.In(leaderSchedKeysToDelete)). |
entries/pkid.go
Outdated
| func PkidBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB, params *lib.DeSoParams) error { | ||
| // We check before we call this function that there is at least one operation type. | ||
| // We also ensure before this that all entries have the same operation type. | ||
| glog.Infof("PkidBatchOperation: Putting %d entries into the database", len(entries)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove this before merging, or if it's necessary for debugging in a deployed environment, just throw a FIXME above it to remove.
2c86c5a to
f0cc0b0
Compare
f0cc0b0 to
14e49c4
Compare
ddeafd4 to
8840576
Compare
14e49c4 to
ac7621e
Compare
ac7621e to
83c472d
Compare

No description provided.