Skip to content

feat: make KVS max snapshot count configurable - #383

Open
atarekra wants to merge 2 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:kvs-configurable-max-snapshots
Open

feat: make KVS max snapshot count configurable#383
atarekra wants to merge 2 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:kvs-configurable-max-snapshots

Conversation

@atarekra

Copy link
Copy Markdown
Contributor

The C++ KVS fixed the number of snapshots at three via the KVS_MAX_SNAPSHOTS macro, so comp_req__kvs__snapshot_max_num ("configurable maximum number of snapshots") was not met and the component integration tests xfailed all C++ boundary cases.

Replace the macro with a namespaced KVS_DEFAULT_MAX_SNAPSHOTS constant and add KvsBuilder::snapshot_max_count(), forwarded through Kvs::open() into a per-instance member used by snapshot counting, rotation and the reported maximum. The value is bound at init-time and immutable afterwards, since lowering it on a live store would orphan snapshot files that rotation would never reclaim.

A configured maximum of zero keeps no previous generation but still persists the current KVS data, matching the Rust backend, which rotates (a no-op at zero) and then always saves snapshot 0.

Also fix SnapshotMaxCount::run reading a "count" field its scenario config never supplies, which the blanket xfail had been hiding.

Resolves #108

The C++ KVS fixed the number of snapshots at three via the
KVS_MAX_SNAPSHOTS macro, so comp_req__kvs__snapshot_max_num
("configurable maximum number of snapshots") was not met and the
component integration tests xfailed all C++ boundary cases.

Replace the macro with a namespaced KVS_DEFAULT_MAX_SNAPSHOTS
constant and add KvsBuilder::snapshot_max_count(), forwarded through
Kvs::open() into a per-instance member used by snapshot counting,
rotation and the reported maximum. The value is bound at init-time
and immutable afterwards, since lowering it on a live store would
orphan snapshot files that rotation would never reclaim.

A configured maximum of zero keeps no previous generation but still
persists the current KVS data, matching the Rust backend, which
rotates (a no-op at zero) and then always saves snapshot 0.

Also fix SnapshotMaxCount::run reading a "count" field its scenario
config never supplies, which the blanket xfail had been hiding.
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

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]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: e8939cc8-e24e-4206-8d53-24acc6011bf8
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)

Analyzing: target //:license-check (62 packages loaded, 10 targets configured)

Analyzing: target //:license-check (90 packages loaded, 10 targets configured)

Analyzing: target //:license-check (147 packages loaded, 1237 targets configured)

Analyzing: target //:license-check (149 packages loaded, 3125 targets configured)

Analyzing: target //:license-check (149 packages loaded, 3125 targets configured)

Analyzing: target //:license-check (149 packages loaded, 3125 targets configured)

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

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

Analyzing: target //:license-check (171 packages loaded, 9067 targets configured)

Analyzing: target //:license-check (176 packages loaded, 11384 targets configured)

Analyzing: target //:license-check (176 packages loaded, 11384 targets configured)

INFO: Analyzed target //:license-check (177 packages loaded, 11510 targets configured).
[13 / 17] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions running)
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 66 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[15 / 17] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
[16 / 17] 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: 33.764s, Critical Path: 2.62s
INFO: 17 processes: 12 internal, 4 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 17 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@Ahmed-Elsaka-JC

Copy link
Copy Markdown
Contributor

@atarekra please resolve merge conflicts

@atarekra

Copy link
Copy Markdown
Contributor Author

@atarekra please resolve merge conflicts

Solved

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.

Improvement: set KVS_MAX_SNAPSHOTS as configuration parameter

2 participants