Skip to content

fix(rust_kvs): sync KVS and hash files to storage on flush - #489

Merged
umaucher merged 1 commit into
eclipse-score:mainfrom
hskang-amelia:fix/rust-kvs-flush-fsync
Oct 15, 2026
Merged

umaucher merged 1 commit into
eclipse-score:mainfrom
hskang-amelia:fix/rust-kvs-flush-fsync

Conversation

@hskang-amelia

Copy link
Copy Markdown
Contributor

JsonBackend::save wrote the KVS and hash files with fs::write, which only hands the data to the OS page cache. A power loss right after flush() could lose the data or leave the KVS and hash files out of step, so the next load fails hash validation.

Write both files through a helper that calls sync_data() after the write, matching the fdatasync() the C++ Kvs::flush() got for #252.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Starting local Bazel server (8.7.0) and connecting to it...
INFO: Invocation ID: 7ed91a0b-c1fb-4495-9a33-25414a4c55ca
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 2 packages loaded
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Analyzing: target //:license-check (3 packages loaded)
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)

Analyzing: target //:license-check (77 packages loaded, 14 targets configured)

Analyzing: target //:license-check (92 packages loaded, 14 targets configured)

Analyzing: target //:license-check (144 packages loaded, 3236 targets configured)

Analyzing: target //:license-check (156 packages loaded, 7248 targets configured)

Analyzing: target //:license-check (162 packages loaded, 9666 targets configured)

Analyzing: target //:license-check (162 packages loaded, 9666 targets configured)

Analyzing: target //:license-check (163 packages loaded, 9790 targets configured)

Analyzing: target //:license-check (167 packages loaded, 15771 targets configured)

Analyzing: target //:license-check (167 packages loaded, 15771 targets configured)

INFO: Analyzed target //:license-check (168 packages loaded, 15897 targets configured).
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 50 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[13 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 27.734s, Critical Path: 2.47s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
[main] INFO Querying Eclipse Foundation for license data for 42 items.
[main] INFO Found 32 items.
[main] INFO Querying ClearlyDefined for license data for 10 items.
[main] INFO Found 10 items.
[main] INFO License information could not be automatically verified for the following content:
[main] INFO 
[main] INFO crate/cratesio/-/lazy_static/1.5.1
[main] INFO 
[main] INFO This content is either not correctly mapped by the system, or requires review.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-489: https://eclipse-score.github.io/persistency/pr-489/

JsonBackend::save wrote the KVS and hash files with fs::write, which
only hands the data to the OS page cache. A power loss right after
flush() could lose the data or leave the KVS and hash files out of
step, so the next load fails hash validation.

Write both files through a helper that calls sync_data() after the
write, matching the fdatasync() the C++ Kvs::flush() got for eclipse-score#252.

Signed-off-by: hskang <amelia@ivis.ai>
@umaucher
umaucher force-pushed the fix/rust-kvs-flush-fsync branch from aeed13a to 95ce1bd Compare October 14, 2026 14:01
@umaucher
umaucher deployed to workflow-approval October 14, 2026 14:01 — with GitHub Actions Active
@umaucher
umaucher deployed to workflow-approval October 14, 2026 14:01 — with GitHub Actions Active
@umaucher
umaucher added this pull request to the merge queue Oct 15, 2026
Merged via the queue into eclipse-score:main with commit feb3fda Oct 15, 2026
19 checks passed
@umaucher umaucher linked an issue Oct 15, 2026 that may be closed by this pull request
1 of 2 tasks
@hskang-amelia
hskang-amelia deleted the fix/rust-kvs-flush-fsync branch October 16, 2026 14:21

This branch was successfully deployed

1 active deployment
workflow-approval — 95ce1bd0 Deployed Oct 14, 2026 by umaucher via qnx-build (per-x86_64-qnx) / approval #910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust_kvs: flush() does not sync KVS and hash files to storage

3 participants