mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 11:32:19 +00:00
fix: Increase lock acquire timeout for network storage reliability (#1548)
This commit is contained in:
@@ -42,19 +42,26 @@ pub use disabled_manager::DisabledLockManager;
|
||||
pub use guard::FastLockGuard;
|
||||
pub use manager::FastObjectLockManager;
|
||||
pub use manager_trait::LockManager;
|
||||
use std::time::Duration;
|
||||
pub use types::*;
|
||||
|
||||
/// Default RustFS specific timeouts in seconds
|
||||
pub(crate) const DEFAULT_RUSTFS_MAX_ACQUIRE_TIMEOUT: u64 = 120;
|
||||
|
||||
/// Default RustFS acquire timeout in seconds
|
||||
pub(crate) const DEFAULT_RUSTFS_ACQUIRE_TIMEOUT: u64 = 60;
|
||||
|
||||
/// Default shard count (must be power of 2)
|
||||
pub const DEFAULT_SHARD_COUNT: usize = 1024;
|
||||
|
||||
/// Default lock timeout
|
||||
pub const DEFAULT_LOCK_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(30);
|
||||
pub const DEFAULT_LOCK_TIMEOUT: Duration = Duration::from_secs(30);
|
||||
|
||||
/// Default acquire timeout - increased for database workloads
|
||||
pub const DEFAULT_ACQUIRE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(30);
|
||||
/// Default acquire timeout - increased for network block storage workloads (e.g., Hetzner Ceph)
|
||||
pub const DEFAULT_ACQUIRE_TIMEOUT: Duration = Duration::from_secs(DEFAULT_RUSTFS_ACQUIRE_TIMEOUT);
|
||||
|
||||
/// Maximum acquire timeout for high-load scenarios
|
||||
pub const MAX_ACQUIRE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(60);
|
||||
pub const MAX_ACQUIRE_TIMEOUT: Duration = Duration::from_secs(DEFAULT_RUSTFS_MAX_ACQUIRE_TIMEOUT);
|
||||
|
||||
/// Lock cleanup interval
|
||||
pub const CLEANUP_INTERVAL: std::time::Duration = std::time::Duration::from_secs(60);
|
||||
pub const CLEANUP_INTERVAL: Duration = Duration::from_secs(60);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use crate::fast_lock::guard::FastLockGuard;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use smartstring::SmartString;
|
||||
use std::hash::{Hash, Hasher};
|
||||
@@ -19,8 +20,6 @@ use std::sync::Arc;
|
||||
use std::sync::OnceLock;
|
||||
use std::time::{Duration, SystemTime};
|
||||
|
||||
use crate::fast_lock::guard::FastLockGuard;
|
||||
|
||||
/// Object key for version-aware locking
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub struct ObjectKey {
|
||||
|
||||
Reference in New Issue
Block a user