Add LeaderScheduleEntry#12
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.
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.
| keysToDelete = consumer.FilterKeysByPrefix(keysToDelete, lib.Prefixes.PrefixSnapshotLeaderSchedule) | |
| leaderSchedKeysToDelete := consumer.FilterKeysByPrefix(keysToDelete, lib.Prefixes.PrefixSnapshotLeaderSchedule) |
There was a problem hiding this comment.
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.
| 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.
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.