Skip to content

Commit

Permalink
feat: add CatchupRequest to engine (#2939)
Browse files Browse the repository at this point in the history
* chore: remove redundant code

* feat(mito): add CatchupRequest

feat: reopen region before replay if need

* chore: apply suggestions from CR

* chore: apply suggestions from CR

* Apply suggestions from code review

Co-authored-by: Yingwen <[email protected]>

---------

Co-authored-by: Yingwen <[email protected]>
  • Loading branch information
WenyXu and evenyag authored Dec 21, 2023
1 parent b5c5458 commit ff8c10e
Show file tree
Hide file tree
Showing 19 changed files with 676 additions and 50 deletions.
3 changes: 2 additions & 1 deletion src/datanode/src/region_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ impl RegionServerInner {
| RegionRequest::Alter(_)
| RegionRequest::Flush(_)
| RegionRequest::Compact(_)
| RegionRequest::Truncate(_) => RegionChange::None,
| RegionRequest::Truncate(_)
| RegionRequest::Catchup(_) => RegionChange::None,
};

let engine = match self.get_engine(region_id, &region_change)? {
Expand Down
2 changes: 2 additions & 0 deletions src/metric-engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ impl RegionEngine for MetricEngine {
RegionRequest::Flush(_) => todo!(),
RegionRequest::Compact(_) => todo!(),
RegionRequest::Truncate(_) => todo!(),
/// It always Ok(0), all data is latest.
RegionRequest::Catchup(_) => Ok(0),
};

result.map_err(BoxedError::new)
Expand Down
2 changes: 2 additions & 0 deletions src/mito2/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ mod alter_test;
#[cfg(test)]
mod basic_test;
#[cfg(test)]
mod catchup_test;
#[cfg(test)]
mod close_test;
#[cfg(test)]
mod compaction_test;
Expand Down
Loading

0 comments on commit ff8c10e

Please sign in to comment.