fix: alway rejects write while downgrading region (#5842)

* fix: alway rejects write while downgrading region

* chore: apply suggestions from CR
This commit is contained in:
Weny Xu
2025-04-11 14:42:41 +08:00
committed by GitHub
parent 84e2bc52c2
commit 5a36fa5e18
18 changed files with 244 additions and 154 deletions

View File

@@ -25,12 +25,13 @@ use session::context::QueryContextRef;
use crate::handlers::ProcedureServiceHandlerRef;
use crate::helper::cast_u64;
const DEFAULT_TIMEOUT_SECS: u64 = 30;
/// The default timeout for migrate region procedure.
const DEFAULT_TIMEOUT_SECS: u64 = 300;
/// A function to migrate a region from source peer to target peer.
/// Returns the submitted procedure id if success. Only available in cluster mode.
///
/// - `migrate_region(region_id, from_peer, to_peer)`, with timeout(30 seconds).
/// - `migrate_region(region_id, from_peer, to_peer)`, with timeout(300 seconds).
/// - `migrate_region(region_id, from_peer, to_peer, timeout(secs))`.
///
/// The parameters: