v0.34.0_1
This commit is contained in:
1 parent
9b3d6731cc
commit
00f29f92c8
68 files changed
+2599
-513
No files matched your search
Vendored
+23
@@ -8,6 +8,7 @@ impl Cache {
|
||||
revision: AtomicU64::new(revision),
|
||||
cold: Arc::new(Mutex::new(ColdStore::default())),
|
||||
tier_settings: Mutex::new(Settings::default()),
|
||||
scope_revisions: Mutex::new(HashMap::new()),
|
||||
data_root: None,
|
||||
cold_tx: None,
|
||||
cold_delete_fallbacks: Arc::new(Semaphore::new(COLD_DELETE_FALLBACKS)),
|
||||
@@ -37,6 +38,16 @@ impl Cache {
|
||||
data_root: Option<PathBuf>,
|
||||
settings: Settings,
|
||||
shutdown: CancellationToken,
|
||||
) -> Arc<Self> {
|
||||
Self::start_with_scope_revisions(revision, data_root, settings, shutdown, HashMap::new())
|
||||
}
|
||||
|
||||
pub fn start_with_scope_revisions(
|
||||
revision: u64,
|
||||
data_root: Option<PathBuf>,
|
||||
settings: Settings,
|
||||
shutdown: CancellationToken,
|
||||
scope_revisions: HashMap<String, u64>,
|
||||
) -> Arc<Self> {
|
||||
let (tx, rx) = mpsc::channel(COLD_QUEUE);
|
||||
let cache = Arc::new(Self {
|
||||
@@ -47,6 +58,7 @@ impl Cache {
|
||||
revision: AtomicU64::new(revision),
|
||||
cold: Arc::new(Mutex::new(ColdStore::default())),
|
||||
tier_settings: Mutex::new(settings),
|
||||
scope_revisions: Mutex::new(scope_revisions),
|
||||
data_root,
|
||||
cold_tx: Some(tx),
|
||||
cold_delete_fallbacks: Arc::new(Semaphore::new(COLD_DELETE_FALLBACKS)),
|
||||
@@ -291,6 +303,17 @@ impl Cache {
|
||||
}
|
||||
}
|
||||
|
||||
/// Block requests bound to an old immutable routing snapshot from creating
|
||||
/// cache tickets during a concurrent configuration publication. This does
|
||||
/// not clear HOT or COLD and does not modify the representation revision.
|
||||
pub fn set_control_revision(&self, revision: u64) {
|
||||
self.store.lock().unwrap_or_else(|e| e.into_inner()).control_revision = revision;
|
||||
}
|
||||
|
||||
pub fn replace_scope_revisions(&self, scopes: HashMap<String, u64>) {
|
||||
*self.scope_revisions.lock().unwrap_or_else(|e| e.into_inner()) = scopes;
|
||||
}
|
||||
|
||||
pub fn configure(&self, settings: Settings) {
|
||||
*self.tier_settings.lock().unwrap_or_else(|e| e.into_inner()) = settings.clone();
|
||||
// Hot-applied limit reductions take effect immediately for published HOT
|
||||
|
||||
Reference in new issue
Block a user