Repository navigation
Patched object_store 0.13.2: LocalFileSystem fsync backport - #4
Conversation
…pache#676) (cherry picked from commit 9b8cf52)
* feat(local): add opt-in fsync to LocalFileSystem for durability * Fix docs --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> (cherry picked from commit dd0afcb)
* fix(local): fsync create-mode rename delete * better (cherry picked from commit 596e1f6)
The close-error tests from apache#676 closed a file and then rebuilt a File from the freed descriptor or handle to close it again. That breaks the from_raw_fd/from_raw_handle contract, and in a parallel test run another thread can be handed the same descriptor in between, so the test could close an unrelated file. Split close_file into close_raw_fd (Unix) and close_raw_handle (Windows) and test those with a value that can never be open: a descriptor at the open-file limit, and a null handle. close_file's behavior is unchanged. Raised in review (Copilot) on #2. (cherry picked from commit 6b7c9a0)
(cherry picked from commit 0c380a1)
…ting (apache#799) Adds a rust-toolchain.toml (mirroring apache/arrow-rs) pinning the toolchain to 1.97.0 so CI uses a stable, reproducible Rust version and is not surprised by new lints in future releases. Rust 1.97.0's clippy added the useless_borrows_in_formatting lint, which flags redundant references in format! arguments. Fixes the resulting failures in the azure module. Closes apache#798 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit e64e8e3)
(cherry picked from commit 98cf6e8)
…ent directories With fsync enabled, create_parent_dirs fsyncs only the directories the same call created. A concurrent write into a directory another write had just created found it existing, fsynced its parent and returned, possibly before the creator had fsynced the ancestor holding that directory's entry; a power loss could then remove the directory and the acknowledged file. create_parent_dirs now registers the directories it is about to create until their fsyncs are done, and every durable write waits while one of its ancestors is registered. Writes into other directories do not wait. (cherry picked from commit 808359a)
A creation's directory fsyncs can fail after it has created the directories, and writes into them then returned success with the new directory entries not known to be durable: writes waiting on the creation were released, and later writes found nothing registered. A failed creation now records its directories as unsynced; the next write under one fsyncs it and its parent before returning, and clears the record. Also document that coordination is per process and by path. (cherry picked from commit 90dc948)
On Windows, canonicalize returns a \\?\ path, which never matched the paths the store syncs. (cherry picked from commit bf82b95)
…he#727) Updates the requirements on [quick-xml](https://github.com/tafia/quick-xml) to permit the latest version. - [Release notes](https://github.com/tafia/quick-xml/releases) - [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md) - [Commits](tafia/quick-xml@v0.39.0...v0.40.1) --- updated-dependencies: - dependency-name: quick-xml dependency-version: 0.40.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit b058903) (cherry picked from commit 80678e3)
…he#785) Updates the requirements on [quick-xml](https://github.com/tafia/quick-xml) to permit the latest version. - [Release notes](https://github.com/tafia/quick-xml/releases) - [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md) - [Commits](tafia/quick-xml@v0.40.1...v0.41.0) --- updated-dependencies: - dependency-name: quick-xml dependency-version: 0.41.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit fd44ebb) (cherry picked from commit 5f09c21)
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved directory-coordination gaps can undermine acknowledged-write durability, and failure paths can retain registry entries and staging files.
4 open issues
What changed in this PR
Backports opt-in LocalFileSystem durability support to object_store 0.13.2 for influxdb_pro, alongside dependency and CI maintenance.
Changes:
- Adds checked file closing and file/directory syncing for writes, copies, renames, and multipart completion.
- Coordinates concurrent directory creation and adds durability regression tests.
- Updates
quick-xml, adds platform-specific dependencies, and applies toolchain and lint fixes.
| File | Description |
|---|---|
src/local.rs |
Implements durability helpers, directory coordination, and tests. |
src/client/list.rs |
Removes redundant iterator conversions. |
src/azure/credential.rs |
Removes redundant formatting borrows and adjusts alignment. |
src/azure/builder.rs |
Removes redundant borrows in endpoint formatting. |
rust-toolchain.toml |
Pins Rust 1.97.0 with rustfmt and clippy. |
Cargo.toml |
Updates XML parsing and adds platform-specific close dependencies. |
Review effort: Balanced
| // afterwards we know exactly which directories are new and need to be fsynced. Registering | ||
| // them makes concurrent writes into them wait for those fsyncs. | ||
| let mut creating = None; | ||
| let first_existing = fsync.then(|| { |
There was a problem hiding this comment.
Pre-existing (upstream apache#643, same in base-object-store-0125). Not reachable from influxdb3, which uses one fsync setting per process. No change in this port.
| if dir == first_existing { | ||
| break; |
There was a problem hiding this comment.
Confirmed; pre-existing (upstream apache#643). Fix in a follow-up fork PR and upstream; no change in this port.
| if !self.synced { | ||
| registry.unsynced.insert(dir.clone()); | ||
| } |
There was a problem hiding this comment.
Confirmed for failed mkdir (EACCES/ENOSPC); a file in the way fails earlier. Fork-only (PR #3). Fix in a follow-up fork PR; no change in this port.
| // Durably publish the freshly-written staging file: flush its contents, close it, then | ||
| // rename it into place and fsync the destination's parent directory (the fsync calls | ||
| // are bundled into the helper and only run when fsync is enabled). | ||
| finish_staged_rename(file, &src, &s.dest, fsync)?; |
There was a problem hiding this comment.
Confirmed; pre-existing upstream (src.take() before the fallible steps). Fix upstream; no change in this port.


Tracking issue: influxdata/influxdb_pro#6262
Patched
object_store0.13.2 for influxdb_pro, which moved to 0.13.2 with DataFusion 53.1.0. Same content as #2 and #3 on 0.12.5: upstream's opt-inLocalFileSystem::with_fsync(shipped upstream in 0.14) plus our fixes. influxdata/influxdb_pro#6818 will pin this branch.base-object-store-0132is upstream tagv0.13.2(7a65b75).What is ported
Cherry-picked from upstream
mainwith-x. All three applied without conflicts: 0.13.2 already hascopy_opts/rename_optsand the optionaltokiofeature these commits were written against, so the hand-portedcopy/rename/rename_if_not_existsvariants from #2 are not needed here.aabf95cclose with error checkingf629d0ewith_fsync0e971cafsync the source delete in create-mode renameOur own commits, replayed from
base-object-store-0125without conflicts:679490aclose-error tests without reusing a closed descriptor (Patched object_store 0.12.5: LocalFileSystem fsync backport #2)3e0e7d9,9a26ada,c00acdadurable writes wait for in-progress parent directory creation, and sync directories a failed creation left (fix(local): a durable write waits for in-progress creation of its parent directories #3)Cherry-picked from upstream to fix CI failures already present on
v0.13.2, as #2 did for 0.12.5:7a78b5c) and Pin Rust toolchain to 1.97.0 and fix clippy apache/arrow-rs-object-store#799 (6e144c4, toolchain pin 1.97.0): clippyuseless_conversionanduseless_borrows_in_formatting;0ec8023formatting.08e5398,b10205d):quick-xml0.39 -> 0.41 for RUSTSEC-2026-0194 and RUSTSEC-2026-0195, which the Audit job reports. Only thequick-xmlline; 0.13.2'srand0.10 stays. Both conflicted on neighbouring lines only.Not ported from
base-object-store-0125:incompatible-rust-versions = fallback), andcargo check --all-featurescannot pass on 1.85: upstream 0.13.2'scloudcode uses let-chains (src/client/token.rs, Switch TokenCache to RWLock apache/arrow-rs-object-store#648), which need Rust 1.88. The job stays as upstream has it, checking default features, which coverfsand the ported code.Testing
Locally on 1.97.0:
cargo fmt --all -- --checkcargo clippy -- -D warningsfor each feature set inci.yml(default, no-default, fs, aws, gcp, azure, http, integration, all-features, all-features/all-targets)cargo doc --document-private-items --no-deps --all-featurescargo test: 94 passed, 1 ignored (lib); 29 passed, 1 ignored (doc).cargo test --all-features: 195 passed, 4 ignored (lib); 49 passed, 1 ignored (doc).cargo +1.85.0 checkwith default features on a lockfile generated by 1.85.0.cargo audit(0.22.2): no vulnerabilities; on barev0.13.2it reports the twoquick-xmladvisories.Against influxdb_pro
main(c44dbb39) with[patch.crates-io] object_store = { path = ... }:cargo check -p influxdb3_clap_blocks(OSS) builds. With influxdb_pro#6818 merged in locally,influxdb3_clap_blocks(lib and tests),influxdb3-enterprise -F no_licenseand its benches build. Lockfile delta in influxdb_pro:quick-xml0.39.4 -> 0.41.0 andnix0.31.3 added.