8000 Delete also from repair_queue by koba-e964 · Pull Request #263 · frugalos/frugalos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Delete also from repair_queue #263

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

Merged
merged 1 commit into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions frugalos_segment/src/queue_executor/repair_queue_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ impl RepairQueueExecutor {
self.enqueued_repair.increment();
}
}
/// Deletes an element from this queue.
/// This is typically called for deleted objects.
pub(crate) fn delete(&mut self, version: ObjectVersion) {
if self.queue.remove(&version) {
self.dequeued_repair.increment();
}
}
fn pop(&mut self) -> Option<ObjectVersion> {
// Pick the minimum element, if queue is not empty.
let result = self.queue.iter().next().copied();
Expand Down
3 changes: 2 additions & 1 deletion frugalos_segment/src/synchronizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ impl Synchronizer {
Event::Putted { .. } => {
self.general_queue.push(event);
}
Event::Deleted { .. } => {
Event::Deleted { version, .. } => {
self.general_queue.push(event);
self.repair_queue.delete(version);
}
// Because pushing FullSync into the task queue causes difficulty in implementation,
// we decided not to push this task to the task priority queue and handle it manually.
Expand Down
0