Skip to content

Commit 50e16fd

Browse files
committed
Initialize min_id to peek_next_id
1 parent 5c86f72 commit 50e16fd

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

upstairs/src/downstairs.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -1372,22 +1372,20 @@ impl Downstairs {
13721372
up_state: &UpstairsState,
13731373
) {
13741374
let extent_count = self.ddef.unwrap().extent_count();
1375-
// Load a partially valid repair state (`min_id` and `state` are bogus);
1376-
// `state` will be updated in `send_live_repair_jobs`, and `min_jobs`
1377-
// will be set once we know the close job ID.
1375+
// Load a partially valid repair state, with a dummy `state` (to be
1376+
// updated in `send_live_repair_jobs`).
13781377
self.repair = Some(LiveRepairData {
13791378
id: Uuid::new_v4(),
13801379
extent_count,
13811380
repair_downstairs: repair_downstairs.to_vec(),
13821381
source_downstairs,
13831382
aborting_repair: false,
13841383
active_extent: ExtentId(0),
1385-
min_id: JobId(0), // fixed below
1384+
min_id: self.peek_next_id(), // upcoming close_id
13861385
repair_job_ids: BTreeMap::new(),
13871386
state: LiveRepairState::dummy(), // fixed when sending jobs
13881387
});
1389-
let extent_repair_ids = self.send_live_repair_jobs(up_state);
1390-
self.repair.as_mut().unwrap().min_id = extent_repair_ids.close_id;
1388+
self.send_live_repair_jobs(up_state);
13911389
}
13921390

13931391
/// Increments `self.repair.active_extent` and sends new jobs
@@ -1413,10 +1411,7 @@ impl Downstairs {
14131411
/// aborting the repair but either (1) the source downstairs is not
14141412
/// `DsState::Active`, or (2) the repair downstairs are not all
14151413
/// `DsState::LiveRepair`.
1416-
fn send_live_repair_jobs(
1417-
&mut self,
1418-
up_state: &UpstairsState,
1419-
) -> ExtentRepairIDs {
1414+
fn send_live_repair_jobs(&mut self, up_state: &UpstairsState) {
14201415
// Keep going!
14211416
let repair = self.repair.as_mut().unwrap();
14221417

@@ -1488,7 +1483,6 @@ impl Downstairs {
14881483
&repair_downstairs,
14891484
)
14901485
};
1491-
extent_repair_ids
14921486
}
14931487

14941488
/// Creates a [DownstairsIO] job for an [IOop::ExtentLiveReopen], and

0 commit comments

Comments
 (0)