v0.6.3
Upgrading from v0.6.2 can use a rolling update. Until every node runs v0.6.3, a v0.6.2 node can still acquire a cell whose ownership record was lost and start it empty. - Outbound TLS no longer trusts emSign ECC Root CA - G3, and it rejects any certificate chain through one of the eight eMudhra intermediate CA certificates whose private keys are public. - rustls 0.23.46 fixes GHSA-2mjx-qc3c-rqvc, where a TLS 1.3 handshake message was accepted across an encryption level boundary. - A node refuses to acquire a cell whose ownership record (`cells/<cell>/own.json`) is missing while its LTX is still in the bucket, instead of starting the cell at epoch 1 with an empty database. Requests that need the record fail, and the node logs `celld ownership record lost` at most once every 10 seconds per cell. The guarantees documentation describes how to restore the record. Issues fixed: - #293: Outbound TLS distrusts the compromised eMudhra CA certificates (webpki-roots 1.0.10, rustls-webpki 0.103.16). Co-authored-by: Yusuke "Taka" Tanaka <[email protected]>
Bartek Iwańczuk authored signed1 parent 90b4301commit 8702f6d186c77698dbfb30cf29e3b1922a88f008Browse files
11 files changed+207−21
Files (11)
modifiedCargo.lock+9−8View file
| @@ -285,7 +285,7 @@ | ||
| 285 | 285 | |
| 286 | 286 | [[package]] |
| 287 | 287 | name = "celld" |
| 288 | -version = "0.6.2" | |
| 288 | +version = "0.6.3" | |
| 289 | 289 | dependencies = [ |
| 290 | 290 | "aes", |
| 291 | 291 | "aes-gcm", |
| @@ -335,6 +335,7 @@ | ||
| 335 | 335 | "rsa", |
| 336 | 336 | "rusqlite", |
| 337 | 337 | "rustls", |
| 338 | + "rustls-webpki", | |
| 338 | 339 | "serde", |
| 339 | 340 | "serde_json", |
| 340 | 341 | "sha1", |
| @@ -2686,9 +2687,9 @@ | ||
| 2686 | 2687 | |
| 2687 | 2688 | [[package]] |
| 2688 | 2689 | name = "rustls" |
| 2689 | -version = "0.23.43" | |
| 2690 | +version = "0.23.46" | |
| 2690 | 2691 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2691 | -checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" | |
| 2692 | +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" | |
| 2692 | 2693 | dependencies = [ |
| 2693 | 2694 | "log", |
| 2694 | 2695 | "once_cell", |
| @@ -2732,9 +2733,9 @@ | ||
| 2732 | 2733 | |
| 2733 | 2734 | [[package]] |
| 2734 | 2735 | name = "rustls-webpki" |
| 2735 | -version = "0.103.13" | |
| 2736 | +version = "0.103.16" | |
| 2736 | 2737 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2737 | -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" | |
| 2738 | +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" | |
| 2738 | 2739 | dependencies = [ |
| 2739 | 2740 | "ring", |
| 2740 | 2741 | "rustls-pki-types", |
| @@ -3144,7 +3145,7 @@ | ||
| 3144 | 3145 | checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" |
| 3145 | 3146 | dependencies = [ |
| 3146 | 3147 | "fastrand", |
| 3147 | - "getrandom 0.4.3", | |
| 3148 | + "getrandom 0.3.4", | |
| 3148 | 3149 | "once_cell", |
| 3149 | 3150 | "rustix 1.1.4", |
| 3150 | 3151 | "windows-sys 0.61.2", |
| @@ -3796,9 +3797,9 @@ | ||
| 3796 | 3797 | |
| 3797 | 3798 | [[package]] |
| 3798 | 3799 | name = "webpki-roots" |
| 3799 | -version = "1.0.9" | |
| 3800 | +version = "1.0.10" | |
| 3800 | 3801 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3801 | -checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" | |
| 3802 | +checksum = "1c1c8e20c8a38fc7d65abfe74eb7280e4aa667e8eec8bc84996d2874810748d9" | |
| 3802 | 3803 | dependencies = [ |
| 3803 | 3804 | "rustls-pki-types", |
| 3804 | 3805 | ] |
modifiedCargo.toml+11−2View file
| @@ -119,7 +119,15 @@ | ||
| 119 | 119 | reqwest = { version = "0.12", default-features = false } |
| 120 | 120 | rsa = { version = "0.9", features = ["sha2"] } |
| 121 | 121 | rusqlite = "0.31" |
| 122 | -rustls = { version = "0.23", default-features = false, features = ["ring"] } | |
| 122 | +# 0.23.45 fixes GHSA-2mjx-qc3c-rqvc, where rustls accepts a TLS 1.3 | |
| 123 | +# handshake message across an encryption level boundary. | |
| 124 | +rustls = { version = "0.23.46", default-features = false, features = ["ring"] } | |
| 125 | +# celld never imports rustls-webpki; this entry only sets a floor. 0.103.16 | |
| 126 | +# rejects every chain through the eight eMudhra intermediate CA certificates | |
| 127 | +# whose private keys are public, and rustls itself accepts 0.103.14. Without | |
| 128 | +# the floor, a resolver can select a version that still trusts those chains | |
| 129 | +# on a host whose own trust store still holds the emSign ECC root. | |
| 130 | +rustls-webpki = { version = "0.103.16", default-features = false } | |
| 123 | 131 | serde = { version = "1", features = ["derive"] } |
| 124 | 132 | serde_json = { version = "1", features = ["raw_value"] } |
| 125 | 133 | sha1 = "0.10" |
| @@ -150,4 +158,5 @@ | ||
| 150 | 158 | # denoland/rusty_v8#2044 and #2045. Both ship in 152.1.0, so this is an |
| 151 | 159 | # ordinary dependency again — no path override, and no hand-built archive. |
| 152 | 160 | v8 = "152.1" |
| 153 | -webpki-roots = "1" | |
| 161 | +# 1.0.10 drops the emSign ECC root, whose intermediate CA keys are public. | |
| 162 | +webpki-roots = "1.0.10" |
modifiedcrates/celld/Cargo.toml+2−1View file
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | [package] |
| 2 | 2 | name = "celld" |
| 3 | -version = "0.6.2" | |
| 3 | +version = "0.6.3" | |
| 4 | 4 | edition = "2021" |
| 5 | 5 | rust-version = "1.94.1" |
| 6 | 6 | license = "Apache-2.0" |
| @@ -67,6 +67,7 @@ | ||
| 67 | 67 | rusqlite = { workspace = true, features = ["backup", "bundled", "hooks", "serialize"] } |
| 68 | 68 | sqlite-vec.workspace = true |
| 69 | 69 | rustls.workspace = true |
| 70 | +rustls-webpki.workspace = true | |
| 70 | 71 | rsa.workspace = true |
| 71 | 72 | serde.workspace = true |
| 72 | 73 | serde_json.workspace = true |
modifiedcrates/celld/actor.rs+76−6View file
| @@ -199,17 +199,76 @@ | ||
| 199 | 199 | Bucket(Arc<BucketOwnership>), |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | +fn ownership_read_failed(error: anyhow::Error) -> Failure { | |
| 203 | + eprintln!("celld ownership read failed: {error:#}"); | |
| 204 | + Failure::Definite | |
| 205 | +} | |
| 206 | + | |
| 202 | 207 | impl Ownership { |
| 208 | + /// Read the record as it is stored. A missing record here means only that | |
| 209 | + /// no record exists now, so this read must not decide a claim; the core | |
| 210 | + /// reads through [`Self::read_owner_for_claim`]. | |
| 203 | 211 | pub(crate) async fn read_owner(&self, cell: &str) -> Result<Option<OwnerRecord>, Failure> { |
| 204 | 212 | match self { |
| 205 | 213 | Self::Memory(memory) => Ok(memory.lock().await.owners.get(cell).cloned()), |
| 206 | - Self::Bucket(bucket) => bucket.read_owner(cell).await.map_err(|error| { | |
| 207 | - eprintln!("celld ownership read failed: {error:#}"); | |
| 208 | - Failure::Definite | |
| 209 | - }), | |
| 214 | + Self::Bucket(bucket) => bucket.read_owner(cell).await.map_err(ownership_read_failed), | |
| 210 | 215 | } |
| 211 | 216 | } |
| 212 | 217 | |
| 218 | + /// Read the record for the core, which claims epoch one as a fresh cell | |
| 219 | + /// when the record is missing. | |
| 220 | + pub(crate) async fn read_owner_for_claim( | |
| 221 | + &self, | |
| 222 | + cell: &str, | |
| 223 | + ) -> Result<Option<OwnerRecord>, Failure> { | |
| 224 | + // Memory ownership runs without replication, so it never has LTX. | |
| 225 | + let Self::Bucket(bucket) = self else { | |
| 226 | + return self.read_owner(cell).await; | |
| 227 | + }; | |
| 228 | + if bucket.lost_record_held(cell, crate::asyncrt::mono_ms()) { | |
| 229 | + return Err(Failure::Definite); | |
| 230 | + } | |
| 231 | + let record = self.read_owner(cell).await?; | |
| 232 | + if record.is_some() | |
| 233 | + || !bucket | |
| 234 | + .ltx_exists(cell) | |
| 235 | + .await | |
| 236 | + .map_err(ownership_read_failed)? | |
| 237 | + { | |
| 238 | + return Ok(record); | |
| 239 | + } | |
| 240 | + // A claim writes the record before any LTX, and celld never deletes | |
| 241 | + // the record, so LTX proves that a record existed before the listing. | |
| 242 | + // A first claim on another node can still write it after the first | |
| 243 | + // read. Only a read after the listing that finds no record proves a | |
| 244 | + // loss; without it, this node fails a request that it can forward and | |
| 245 | + // reports a record that exists. | |
| 246 | + if let Some(record) = self.read_owner(cell).await? { | |
| 247 | + return Ok(Some(record)); | |
| 248 | + } | |
| 249 | + // A missing record tells the core that the cell was never owned, so | |
| 250 | + // the core claims epoch one as a fresh cell and the activation | |
| 251 | + // restores nothing. celld never deletes `own.json`, but a bucket | |
| 252 | + // lifecycle rule, a manual cleanup, or a partial bucket copy can. The | |
| 253 | + // cell would then serve an empty database beside its acknowledged | |
| 254 | + // chain and ship over `e1/`, and a node that asks while the owner | |
| 255 | + // still serves would become a second writer. Failing the read writes | |
| 256 | + // nothing: each claim fails until an operator restores the record and | |
| 257 | + // the hold ends. | |
| 258 | + // A refusal in `LtxRepl::activate_with` comes too late, because the | |
| 259 | + // claim has already written a record at epoch one. Each later wake | |
| 260 | + // then advances one epoch, and a wake without a takeover can reuse a | |
| 261 | + // stale local eviction snapshot, which skips the used-epoch check. | |
| 262 | + eprintln!( | |
| 263 | + "celld ownership record lost: cells/{cell}/own.json is missing, but the bucket \ | |
| 264 | + holds LTX under cells/{cell}/ltx/; refusing to claim {cell} as a new cell for \ | |
| 265 | + {} s. See the ownership record repair in docs/guarantees.md.", | |
| 266 | + crate::ownership_store::LOST_RECORD_RECHECK_MS / 1_000 | |
| 267 | + ); | |
| 268 | + bucket.hold_lost_record(cell, crate::asyncrt::mono_ms()); | |
| 269 | + Err(Failure::Definite) | |
| 270 | + } | |
| 271 | + | |
| 213 | 272 | async fn read_node_lease(&self, owner: &str) -> Result<Option<NodeLeaseRecord>, Failure> { |
| 214 | 273 | match self { |
| 215 | 274 | Self::Memory(memory) => Ok(memory.lock().await.leases.get(owner).cloned()), |
| @@ -2326,13 +2385,22 @@ | ||
| 2326 | 2385 | .await |
| 2327 | 2386 | } |
| 2328 | 2387 | |
| 2388 | + /// Build an Actor on the scripted cell host with the caller's peer client. | |
| 2389 | + /// | |
| 2390 | + /// `main` passes one client to both the Actor and the AppHandle of a node, | |
| 2391 | + /// and the caller of this constructor can do the same. The arguments are | |
| 2392 | + /// those of `from_environment`, with the scripted host in place of the | |
| 2393 | + /// runtime and with that client added. The added client puts the | |
| 2394 | + /// constructor one argument over the Clippy limit. | |
| 2329 | 2395 | #[cfg(all(test, celld_internal_tests))] |
| 2396 | + #[allow(clippy::too_many_arguments)] | |
| 2330 | 2397 | pub(crate) async fn from_environment_with_scripted_host( |
| 2331 | 2398 | limits: AdmissionLimits, |
| 2332 | 2399 | fail_publish_once: bool, |
| 2333 | 2400 | fence: mpsc::UnboundedSender<i32>, |
| 2334 | 2401 | host: crate::conformance_sim_cell_host::SimCellHost, |
| 2335 | 2402 | ownership: Option<Ownership>, |
| 2403 | + peer_http: reqwest::Client, | |
| 2336 | 2404 | identity: ActorIdentity, |
| 2337 | 2405 | resume_generation: Option<String>, |
| 2338 | 2406 | ) -> anyhow::Result<Self> { |
| @@ -2345,7 +2413,7 @@ | ||
| 2345 | 2413 | host: Some(CellHost::Scripted(host)), |
| 2346 | 2414 | drain_pins: DrainPinRegistry::default(), |
| 2347 | 2415 | ownership, |
| 2348 | - peer_http: reqwest::Client::new(), | |
| 2416 | + peer_http, | |
| 2349 | 2417 | peer_auth, |
| 2350 | 2418 | }, |
| 2351 | 2419 | identity, |
| @@ -2367,6 +2435,7 @@ | ||
| 2367 | 2435 | fence: mpsc::UnboundedSender<i32>, |
| 2368 | 2436 | host: crate::conformance_sim_cell_host::SimCellHost, |
| 2369 | 2437 | ownership: Option<Ownership>, |
| 2438 | + peer_http: reqwest::Client, | |
| 2370 | 2439 | identity: ActorIdentity, |
| 2371 | 2440 | decision_state: ScriptedActorDecisionState, |
| 2372 | 2441 | ) -> anyhow::Result<Self> { |
| @@ -2397,6 +2466,7 @@ | ||
| 2397 | 2466 | fence, |
| 2398 | 2467 | host, |
| 2399 | 2468 | ownership, |
| 2469 | + peer_http, | |
| 2400 | 2470 | identity, |
| 2401 | 2471 | resume_generation, |
| 2402 | 2472 | ) |
| @@ -3237,7 +3307,7 @@ | ||
| 3237 | 3307 | let timing_cell = cell.clone(); |
| 3238 | 3308 | out.spawn_scoped(async move { |
| 3239 | 3309 | let started = crate::asyncrt::mono_ms(); |
| 3240 | - let result = ownership.read_owner(&cell).await; | |
| 3310 | + let result = ownership.read_owner_for_claim(&cell).await; | |
| 3241 | 3311 | CompletedEffect::timed( |
| 3242 | 3312 | Event::OwnerRead { |
| 3243 | 3313 | op, |
modifiedcrates/celld/ownership_store.rs+47−0View file
| @@ -383,6 +383,15 @@ | ||
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | +/// How long a node refuses a cell whose record it found lost before it reads | |
| 387 | +/// the bucket again. A due alarm of a dormant cell retries its wake every | |
| 388 | +/// 100 ms, and a draining donor retries a handoff every 250 ms, so without a | |
| 389 | +/// hold a lost record costs two GETs and a LIST, and one stderr line, per | |
| 390 | +/// retry until an operator repairs it. The hold stays below the default 25 s | |
| 391 | +/// no-progress window of a shutdown handoff and the default 60 s wake scan, | |
| 392 | +/// so a repair takes effect well within either. | |
| 393 | +pub(crate) const LOST_RECORD_RECHECK_MS: u64 = 10_000; | |
| 394 | + | |
| 386 | 395 | /// The production-compatible conditional object store used by ownership |
| 387 | 396 | /// effects. A failed write is reported to the core as ambiguous unless the |
| 388 | 397 | /// store definitively returned HTTP 412, or the attempt provably wrote no |
| @@ -416,6 +425,9 @@ | ||
| 416 | 425 | /// (one publish outstanding at a time), >= S implies the applied body |
| 417 | 426 | /// IS the waiter's object. |
| 418 | 427 | applied: tokio::sync::watch::Sender<(String, u64)>, |
| 428 | + /// Each cell whose record this node found lost, with the monotonic time | |
| 429 | + /// at which its hold ends. See [`LOST_RECORD_RECHECK_MS`]. | |
| 430 | + lost_records: std::sync::Mutex<std::collections::BTreeMap<String, u64>>, | |
| 419 | 431 | } |
| 420 | 432 | |
| 421 | 433 | /// What this node currently looks like, for peers deciding where to place a |
| @@ -513,6 +525,7 @@ | ||
| 513 | 525 | ambient_load_override: None, |
| 514 | 526 | own_log: std::sync::Mutex::new((0, None)), |
| 515 | 527 | applied: tokio::sync::watch::channel((String::new(), 0)).0, |
| 528 | + lost_records: std::sync::Mutex::default(), | |
| 516 | 529 | } |
| 517 | 530 | } |
| 518 | 531 | |
| @@ -581,6 +594,40 @@ | ||
| 581 | 594 | Ok(Some(record)) |
| 582 | 595 | } |
| 583 | 596 | |
| 597 | + /// Whether the bucket holds any LTX for `cell`. LTX exists only under an | |
| 598 | + /// epoch that a claim opened, and the claim writes the ownership record | |
| 599 | + /// first, so LTX proves that a record existed before the listing. | |
| 600 | + pub async fn ltx_exists(&self, cell: &str) -> anyhow::Result<bool> { | |
| 601 | + self.bucket.list_any(&format!("cells/{cell}/ltx")).await | |
| 602 | + } | |
| 603 | + | |
| 604 | + /// Whether this node found the record of `cell` lost less than | |
| 605 | + /// [`LOST_RECORD_RECHECK_MS`] ago. An ended hold is dropped, so the | |
| 606 | + /// caller reads the bucket again. | |
| 607 | + pub(crate) fn lost_record_held(&self, cell: &str, now_mono_ms: u64) -> bool { | |
| 608 | + let mut lost = self.lost_records.lock().unwrap(); | |
| 609 | + match lost.get(cell) { | |
| 610 | + Some(until) if now_mono_ms < *until => true, | |
| 611 | + Some(_) => { | |
| 612 | + lost.remove(cell); | |
| 613 | + false | |
| 614 | + } | |
| 615 | + None => false, | |
| 616 | + } | |
| 617 | + } | |
| 618 | + | |
| 619 | + /// Hold a confirmed loss of the record of `cell`. Ended holds are dropped | |
| 620 | + /// here as well, so the map keeps only the cells refused within the last | |
| 621 | + /// hold interval. | |
| 622 | + pub(crate) fn hold_lost_record(&self, cell: &str, now_mono_ms: u64) { | |
| 623 | + let mut lost = self.lost_records.lock().unwrap(); | |
| 624 | + lost.retain(|_, until| now_mono_ms < *until); | |
| 625 | + lost.insert( | |
| 626 | + cell.to_string(), | |
| 627 | + now_mono_ms.saturating_add(LOST_RECORD_RECHECK_MS), | |
| 628 | + ); | |
| 629 | + } | |
| 630 | + | |
| 584 | 631 | pub async fn read_node_lease(&self, owner: &str) -> anyhow::Result<Option<NodeLeaseRecord>> { |
| 585 | 632 | load_node_lease(&self.bucket, owner).await |
| 586 | 633 | } |
modifiedcrates/logic/lib.rs+5−1View file
| @@ -81,7 +81,11 @@ | ||
| 81 | 81 | pub struct RestoreSpec { |
| 82 | 82 | pub epoch: Epoch, |
| 83 | 83 | /// This activation conditionally created epoch one, so no replica can |
| 84 | - /// precede it. | |
| 84 | + /// precede it. The bucket shell reports a missing record only when no LTX | |
| 85 | + /// exists under `cells/<cell>/ltx/`. A record deleted outside celld | |
| 86 | + /// therefore produces a fresh activation only when that prefix holds no | |
| 87 | + /// LTX of the cell: before the first drain of a node bundle, or after the | |
| 88 | + /// LTX was deleted as well. | |
| 85 | 89 | pub fresh: bool, |
| 86 | 90 | /// Ownership was seized from a different node (or a released record), so |
| 87 | 91 | /// a previous local eviction cache is not authoritative. |
modifieddocs/README.md+6−0View file
| @@ -542,6 +542,12 @@ | ||
| 542 | 542 | failure on the owner of a forwarded Durable Object fetch can reach the |
| 543 | 543 | caller as a 500 response. A v0.6.2 pair rejects the caller's `stub.fetch()` |
| 544 | 544 | instead, as a local owner does. A rollback to v0.6.1 can also roll. |
| 545 | +- **v0.6.2 to v0.6.3: rolling.** A v0.6.3 node no longer trusts the | |
| 546 | + emSign ECC Root CA - G3 certificate or the eight compromised eMudhra | |
| 547 | + intermediate CA certificates for outbound TLS, so upgrade each node | |
| 548 | + promptly. Until every node runs v0.6.3, a v0.6.2 node can still acquire a | |
| 549 | + cell whose ownership record was lost and start the cell with an empty | |
| 550 | + database. A rollback to v0.6.2 can also roll. | |
| 545 | 551 | |
| 546 | 552 | ## Diagnose a fleet |
| 547 | 553 |
modifieddocs/guarantees.md+48−0View file
| @@ -70,6 +70,13 @@ | ||
| 70 | 70 | `deploy-blobs/`, `log/`, `wake/`, and `telemetry/`, and deletes objects under |
| 71 | 71 | some of them. An application must not write under any of them. |
| 72 | 72 | |
| 73 | +An operator must not delete, expire, or overwrite an object under these | |
| 74 | +prefixes, except under `probe/` and `telemetry/`. celld reads these objects to | |
| 75 | +fence and restore cells, and celld deletes the objects that it no longer needs. | |
| 76 | +A bucket lifecycle rule therefore must not select an object under another | |
| 77 | +reserved prefix. With a key prefix, each reserved prefix follows the key prefix, | |
| 78 | +for example `PREFIX/telemetry/`. | |
| 79 | + | |
| 73 | 80 | ## The supervisor |
| 74 | 81 | |
| 75 | 82 | Run celld under a supervisor that restarts the process, such as systemd, Docker |
| @@ -88,6 +95,47 @@ | ||
| 88 | 95 | two nodes cannot acquire the same cell. Every activation, a takeover or a local |
| 89 | 96 | wake, advances the epoch, so an epoch never has two writers. |
| 90 | 97 | |
| 98 | +The record is `cells/<cell>/own.json`. celld never deletes it, and it must stay | |
| 99 | +in the bucket for the life of the cell. A missing record next to LTX under | |
| 100 | +`cells/<cell>/ltx/` means that the record was lost, for example to a lifecycle | |
| 101 | +rule. celld then refuses to acquire the cell, because a new record at epoch 1 | |
| 102 | +would start it with an empty database. Each request that must read the record, | |
| 103 | +to acquire the cell or to find its owner, fails, and the node writes | |
| 104 | +`celld ownership record lost` to stderr. The node then refuses the cell for 10 | |
| 105 | +seconds without a bucket request, so it writes the line at most once in that | |
| 106 | +interval. A node that still serves the cell keeps serving it and keeps writing | |
| 107 | +LTX until it stops. That node cannot acknowledge a write that a bucket proof | |
| 108 | +covers, because the record no longer names it, so the write fails and the node | |
| 109 | +writes `celld output gate` to stderr. With `CELLD_DURABILITY=bucket`, every | |
| 110 | +write takes a bucket proof. celld detects the loss only from LTX under | |
| 111 | +`cells/<cell>/ltx/`. A new cell can keep its first writes in a node bundle under | |
| 112 | +`log/` until the tiering path drains them, so a loss before that drain starts | |
| 113 | +the cell empty. | |
| 114 | + | |
| 115 | +To restore the cell, first stop each node that served the cell with SIGTERM, not | |
| 116 | +with `POST /shutdown?handoff=preserve`. A preserved restart resumes its cells | |
| 117 | +without a read of the record, so the node keeps serving the cell. No peer can | |
| 118 | +acquire the cell, so its handoff cannot complete: the stop can take the whole | |
| 119 | +`CELLD_SHUTDOWN_TOTAL_MS` and log `shutdown_handoff_stalled`. | |
| 120 | + | |
| 121 | +A stopped process can still hold acknowledged writes in its node log, outside | |
| 122 | +the per-cell prefixes, so wait until that log is recovered. A new process with | |
| 123 | +the same `CELLD_NODE` recovers it during startup, so the log is recovered when | |
| 124 | +that process reports healthy. Without the same `CELLD_NODE`, a running node | |
| 125 | +with `CELLD_DURABILITY=fleet`, the default, recovers it after the lease of the | |
| 126 | +stopped process expires. In that case, wait until `nodes/<node>.json` of the | |
| 127 | +stopped process is absent, has no `log` object, or shows `"state": "sealed"` in | |
| 128 | +it. A stop that logs `node-log close: sealed epoch` has already sealed its log. | |
| 129 | + | |
| 130 | +Then write a released record, which names no node, at the newest epoch: the | |
| 131 | +numerically highest `e<epoch>` prefix under `cells/<cell>/ltx/`. For a newest | |
| 132 | +epoch of 7, the record is `{"node": "", "epoch": 7}`. After the refusal interval | |
| 133 | +ends, the next request acquires the cell at the next epoch and restores it from | |
| 134 | +the bucket. A released record skips the recovery of the node log of the | |
| 135 | +previous owner. A record that is written before these logs are recovered can | |
| 136 | +therefore lose acknowledged writes, and a node that still serves the cell | |
| 137 | +becomes a second writer. | |
| 138 | + | |
| 91 | 139 | ### The epoch prefix |
| 92 | 140 | |
| 93 | 141 | The replicator copies each cell's SQLite data to `cells/<cell>/ltx/e<epoch>/` |
modifieddocs/limitations.md+1−1View file
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # Limitations |
| 2 | 2 | |
| 3 | -celld v0.6.2 is a beta release with these operational limits. See | |
| 3 | +celld v0.6.3 is a beta release with these operational limits. See | |
| 4 | 4 | [Cloudflare compatibility](cloudflare-compat.md) for the supported services, |
| 5 | 5 | APIs, and Wrangler configuration. |
| 6 | 6 |
modifieddocs/security.md+1−1View file
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # Security |
| 2 | 2 | |
| 3 | -celld v0.6.2 is a beta release. It is not safe for hostile multi-tenant use. | |
| 3 | +celld v0.6.3 is a beta release. It is not safe for hostile multi-tenant use. | |
| 4 | 4 | Only the latest release receives security fixes. |
| 5 | 5 | |
| 6 | 6 | ## Security boundary |
modifieddocs/telemetry.md+1−1View file
| @@ -16,7 +16,7 @@ | ||
| 16 | 16 | | --- | --- | --- | |
| 17 | 17 | | `CELLD_OTEL` | `0` | `0` disables telemetry. `1` writes Parquet to the fleet bucket. An HTTP(S) collector base URL selects OTLP/HTTP protobuf. | |
| 18 | 18 | | `CELLD_OTEL_BUCKET` | the fleet bucket | A different bucket for the Parquet files, on the same endpoint and credentials. | |
| 19 | -| `CELLD_OTEL_RETENTION` | `30d` | celld deletes telemetry files older than this. `none` disables the deletion, so your own lifecycle rules can control the data. | | |
| 19 | +| `CELLD_OTEL_RETENTION` | `30d` | celld deletes telemetry files older than this. `none` disables the deletion, so your own lifecycle rules can control the data. In the fleet bucket, such a rule must select only the `telemetry/` prefix, after the key prefix if the bucket value has one. [Guarantees](guarantees.md) lists the reserved prefixes that a rule must not select. | | |
| 20 | 20 | | `CELLD_OTEL_FLUSH_MS` | `300000` | celld writes a Parquet file after this many milliseconds of buffered events. | |
| 21 | 21 | | `CELLD_OTEL_FLUSH_BYTES` | `5242880` | The estimated buffered bytes that trigger a flush before the interval ends. | |
| 22 | 22 | | `OTEL_TRACES_SAMPLER` | `parentbased_always_on` | A standard sampler name. `traceidratio` with `OTEL_TRACES_SAMPLER_ARG` records a fraction of the traces. | |