forked from tikv/tikv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: support read only and recovery when disk full (tikv#10264)
* [feature] support read only and recovery when disk full. 1. when disk full, all the business write traffic will not be allowed. 2. no mather minority or majority or all servers disk full happen, you can recove by adding machines or storage, then service normally. Signed-off-by: tier-cap <[email protected]> * [feature] support read only and recovery when disk full. adjust impl on reviews. Signed-off-by: tier-cap <[email protected]> * [feature] support read only and recovery when disk full. opt one test case taking long time prbs. Signed-off-by: tier-cap <[email protected]> * [feature] support read only and recovery when disk full. change ut impl on reviews. Signed-off-by: tier-cap <[email protected]> * [feature] support read only and recovery when disk full. change ut impl on reviews. Signed-off-by: tier-cap <[email protected]> * [feature] support read only and recovery when disk full. remote the unused code and commend Signed-off-by: tier-cap <[email protected]> * clean up tests and fix a bug about transfer leader Signed-off-by: qupeng <[email protected]> * a little fix Signed-off-by: qupeng <[email protected]> * disk full recovery change 3 details 1. config change allowed 2. campaign success log allowed 3. add the raft engine size stats. Signed-off-by: tier-cap <[email protected]> * fix one bug Signed-off-by: tier-cap <[email protected]> * change details by review comment. Signed-off-by: tier-cap <[email protected]> * simplify some impls by comments. Signed-off-by: tier-cap <[email protected]> * change the atomic var access mode by review comments Signed-off-by: tier-cap <[email protected]> Co-authored-by: tier-cap <[email protected]> Co-authored-by: qupeng <[email protected]>
- Loading branch information
1 parent
338aabf
commit 46e539a
Showing
15 changed files
with
294 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,5 @@ fuzz-incremental/ | |
/db/ | ||
/last_tikv.toml | ||
/raft/ | ||
core.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. | ||
use fail::fail_point; | ||
use std::sync::atomic::{AtomicBool, Ordering}; | ||
static DISK_FULL: AtomicBool = AtomicBool::new(false); | ||
|
||
pub fn set_disk_full() { | ||
DISK_FULL.store(true, Ordering::Release); | ||
} | ||
|
||
pub fn clear_disk_full() { | ||
DISK_FULL.store(false, Ordering::Release); | ||
} | ||
|
||
pub fn is_disk_full() -> bool { | ||
DISK_FULL.load(Ordering::Acquire) | ||
} | ||
|
||
pub fn disk_full_precheck(_store_id: u64) -> bool { | ||
fail_point!("disk_full_peer_1", _store_id == 1, |_| true); | ||
fail_point!("disk_full_peer_2", _store_id == 2, |_| true); | ||
false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.