Skip to content

Restore legacy CI builds and stabilize mixed-pattern validation - #540

Merged
fcostaoliveira merged 6 commits into
masterfrom
fix/ci-validation-prerequisites
Sep 20, 2026
Merged

fcostaoliveira merged 6 commits into
masterfrom
fix/ci-validation-prerequisites

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

The existing CI matrix fails before feature validation because Bullseye security package URLs are missing and the macOS OpenSSL 1.0.2 job mixes legacy SSL libraries with libevent's newer headers. This repairs those prerequisites while retaining every platform cell: use the signed final Bullseye security snapshot, and build SHA-256-pinned libevent 2.1.12 against the same legacy OpenSSL installation. Expiry checking is disabled only for the immutable security snapshot; signature verification remains enabled.

A separate test-only commit corrects a pre-existing cluster TLS failure. The mixed-key test assumed a fixed Pearson correlation for pooled Zipfian HSET and sequential HGETALL samples. Over absolute indices 950000–1000000, the Zipf probabilities differ by only about 5%; cluster scheduling changes the pooled histogram even when HSET samples are identical. The replacement verifies each command's key pattern, waits for MONITOR acknowledgement, and compares exact captured counts with Redis and benchmark JSON. Existing low-range Zipfian skew tests remain. No production C++ changes.

Validation:

  • Both Bullseye jobs and the macOS legacy SSL job passed repeatedly with these exact repairs during Support HSCAN, SSCAN and ZSCAN cursor iteration #539 validation. Local Bullseye Docker build/unit checks and a real OpenSSL 1.0.2u/libevent build also passed.
  • The old mixed-key assertion failed in 3/8 unmodified-master runs and 2/8 feature runs under constrained scheduling, despite identical HSET samples.
  • The corrected eight-test Zipfian module passed standalone/cluster × plaintext/TLS (32 cases), plus six constrained baseline/current reruns. Both shared helper entrypoints now also await MONITOR acknowledgement; the complete four-cell module matrix passed again after that change.
  • Swapped command patterns and a frozen sequential key fail the new assertions; exact accounting remains checked. Six malformed-capture cases now fail with clear assertions rather than secondary Python exceptions.
  • Both Bullseye source rewrites explicitly verify the active snapshot line. macOS linkage verification checks every linked libevent against the custom prefix and rejects modern SSL/crypto dependencies, including transitive dependencies. Nineteen extracted shell fixtures and an independent second review passed.
  • The sequential prefix bound is documented as a conservative margin for this static, healthy workload. Exact accounting intentionally rejects unexpected redirects/errors; it is not a general retry-count invariant.

Split from #539 following review so these independent validation repairs can be reviewed and reverted separately. Merge this prerequisite first. Both PRs target master so the existing full CI workflows run; #539 can then be rebased as needed to remove these prerequisite changes from its diff. All applicable CI checks passed on 4d7e510 (119 successful; six intentional conditional skips), including both review bots. The StatsD job passed on a targeted retry after a pre-test download connection reset. Maintainer approval is still required before merging.

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

🤖 Automated first-pass review — a human maintainer's review is still required before merge.

Thanks for this, and for splitting it out of #539 — going through it separately is the right call and makes both diffs readable. Went through most of it, a few comments below. No production C++ here, so this is mostly about whether the CI repairs hold up and whether the new test oracle is actually tighter than the one it replaces.

tests/zipfian_benchmark_runner.py:147 and :226 — you were careful in tests_oss_zipfian_distribution.py about RLTest's soft assertions ("stop before min/max or int() can replace the actual capture failure with an unrelated Python exception", and you return after each assertTrue(False, ...)). But the two readiness waits in the runner are bare soft asserts: if ready.wait(timeout=10) returns False, or if Monitor.__enter__ raised and ready was never set at all, the helper still falls through to benchmark.run() and the test proceeds on a racy capture. That's exactly the "real failure replaced by a confusing downstream one" case you guarded against in the other file — shouldn't these bail out the same way?

.github/workflows/ci.yml:9 / :29 — did you consider archive.debian.org/debian-security bullseye-security here rather than a pinned snapshot.debian.org timestamp? snapshot.debian.org is aggressively rate-limited and 503s under CI load, which would trade a hard failure for a flaky one, and nobody six months from now will know how to refresh 20260903T220410Z. If archive.debian.org isn't populated for bullseye yet, that's a fine answer — but it'd be worth a word in the comment, since that's the question the next person hits. Related: the sed only rewrites the bullseye-security line; bullseye and bullseye-updates still point at deb.debian.org. Does that survive full archival, or are we back here shortly? The grep guard is a good instinct either way.

Also, that whole sed+grep block is duplicated verbatim across the two jobs, with the snapshot timestamp hardcoded in both places — they have to move in lockstep. A tiny composite action or a script in the repo would remove the drift risk. Not blocking, just the kind of duplication that bites later.

tests_oss_zipfian_distribution.py:413+ — I think your reasoning about the old Pearson assertion is right: over 950000–1000000 with absolute indices, Zipf really is ~uniform, so the pooled correlation was never a valid invariant. But that cuts the other way too — is there anything left in this test that would fail if the HSET side used --command-key-pattern=R instead of Z? max - min > 0.8 * (key_max - key_min) passes for uniform sampling just as happily. If not, that's fine, but then the test is really about mixed-pattern plumbing and exact accounting, not Zipf, and the name/docstring still promise the latter. Worth saying so explicitly so the next person doesn't re-add a distributional assertion here.

tests_oss_zipfian_distribution.py:211 — the len(sequential_numbers) / sequential_span >= 0.9 density check leans on the same mechanism your comment cites as hole-producing (get_key_for_conn generating before routing, deferred attempts consuming indices). I think it holds because 50 clients all walk the same prefix independently, so a hole needs every client to skip the same index — but that's load-bearing and isn't written down. Since this test is being fixed precisely for flakiness, it'd be worth one line saying the density bound depends on client multiplicity, not just on the sequential generator.

.github/workflows/ci.yml:515-560 — stepping back: is the macOS OpenSSL 1.0.2 cell still earning its keep? This adds a from-source libevent build to every CI run plus ~40 lines of bespoke otool linkage checking, to keep a cell on an OpenSSL branch that's been EOL since 2019, sourced from a third-party tap (rbenv/tap/[email protected]) that could disappear on us. The repair itself looks sound to me — the SHA-256 pin, the PKG_CONFIG_PATH wiring, the --version | grep 'OpenSSL 1.0.2' guard, and the transitive linkage sweep all do what you say they do, and the final otool -L .../libevent_openssl.dylib doubles as a check that libevent actually found the legacy SSL. I'd just rather someone decide the cell is worth this much machinery than inherit it by default. This one may be worth a second look from whoever owns the release/packaging matrix.

The exact MONITOR-vs-commandstats-vs-mb.json accounting is a genuinely stronger oracle than what it replaces, and the ordering argument behind it (single-threaded feed, INFO COMMANDSTATS as the stop sentinel after CONFIG RESETSTAT) checks out to me. I'd mainly want the soft-assert fallthrough in the runner fixed and the snapshot-vs-archive question answered before this merges.

(would file this as a comment, not a formal block)

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Addressed the review in e95fb1a:

  • macOS now verifies every binary-linked libevent library uses the custom prefix, then inspects each library's dependencies. Foreign libevent and non-1.0.0 SSL/crypto ABIs are rejected. pipefail also makes failed otool inspection fail the step. Sixteen extracted-shell fixtures passed, with a separate reviewer independently checking positive and negative cases against paths from the successful macOS job.
  • Both Bullseye rewrites now assert the exact active snapshot source immediately after sed. Missing, commented, or changed-format sources fail with a direct diagnostic; signature checking remains enabled.
  • Empty captures, wrong prefixes, and nonnumeric suffixes now assert and return before range calculations. Six fault injections each produce one clear failure without a secondary exception. The eight-test module passes all four standalone/cluster × plaintext/TLS cells again (32/32).
  • The sequential bound is explicitly a conservative margin for this healthy static fixture: the 1:1 workload nominally generates half the request count in sequential commands; routing lookahead can consume indices before command completion. Four times that nominal prefix still rejects full-range random sampling. It is not claimed as a universal mathematical bound under failures or retries.
  • The count equality is also fixture-specific. This workload does not enable --retry-on-error, and already requires every expected command to execute. Redis rejects MOVED before MONITOR/normal command-call accounting; memtier can count a MOVED response and a successful replay separately. Therefore this is deliberately not a claim that arbitrary retries are counted once. Unexpected redirects/errors should fail this controlled fixture, rather than be normalized away.

No production C++ changed. Independent reviewers approve these changes; the actual macOS and full CI gates are running on this head.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

The actual macOS gate caught a BSD awk portability issue in the new linkage guard (the binary built successfully): slash delimiters inside negated character classes also require escaping. Fixed in 0978581.

Reproduced the exact pre-fix parser error locally with One True Awk 20231127. All sixteen extracted-workflow fixtures now pass with both One True Awk and Linux mawk. The full macOS gate is rerunning; no production or integration-test code changed.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Checked the follow-up questions against the implementation and current repository endpoints:

  • Sequential S does not partition the range across clients. client::setup_client() partitions only P; each cloned generator retains the full min/max and resets its iterators, and S starts at key_min. This fixture already runs 2 threads × 10 clients. Additional clients repeat the prefix rather than shifting it, so multiplying its bound by the client count would weaken the test incorrectly. The conservative routing-lookahead margin and its static-workload scope are documented.
  • Capture starts only after MONITOR acknowledgement, then ends at each connection's INFO COMMANDSTATS marker after the benchmark completes; joining drains through that marker. MONITOR uses the normal output-buffer class, which has no default size limit. Exact equality is intentionally sensitive to lost capture or unexpected routing/errors. It diagnoses evidence we cannot trust instead of letting an incomplete histogram pass.
  • The archive alternative is currently unavailable: https://archive.debian.org/debian-security/dists/bullseye-security/Release returns HTTP 404. The pinned security snapshot returns 200, and the current Bullseye main repository also returns 200. Thus changing both sources is not needed to repair the observed failure. Both Bullseye jobs and the corrected macOS job pass on this head. Retiring a supported CI platform is a separate maintainer policy decision; this PR preserves the current matrix and does not invent a retirement date.
  • The docstring already describes the configured workload as simultaneous Zipfian HSET/sequential HGETALL in a high keyspace; it does not claim to prove high-range Zipf shape. The detailed assertion comment explicitly assigns skew validation to the existing low-range tests. We retained the older redundant range assertions to keep this oracle correction focused. The configured request count is 1000; the test is not a parameterized tiny-sample test.
  • A readiness failure already records an explicit assertion. An immediate return there would leave started MONITOR threads without their normal stop marker and join. Improving the shared monitor's exception reporting/lifecycle can be separate work; this change does not silently accept a dropped capture, and the empty-capture guards already provide a clear failure. The new scan helper independently has bounded I/O and cleanup fault tests.
  • There is no prom_scrape.txt change in this PR: the complete diff contains only ci.yml, tests_oss_zipfian_distribution.py, and zipfian_benchmark_runner.py.

No further code change is warranted for the partition concern. The corrected-head matrix and expanded feature soak gates continue running.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0978581. Configure here.

Comment thread .github/workflows/ci.yml Resolved
@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Addressed the remaining readiness request in 4d7e510: both shared ZipfianBenchmarkRunner entrypoints now await the MONITOR acknowledgement before launching their benchmarks, using the existing gate. Added the explicit S-repeats-prefix/P-partitions explanation beside the density checks.

The complete eight-test module passed again in standalone/cluster × plaintext/TLS (32/32). Six malformed-capture injections still yield clear failures without exceptions. Independent reviewers approve.

A lost MONITOR stream is deliberately a test failure: incomplete evidence must not be accepted as a valid key-distribution result. ACK-before-work and the post-benchmark INFO marker/join establish the intended capture interval; the normal output buffer has no default limit. We have not observed snapshot rate-limit/cache failures in the repeatedly passing Bullseye/macOS cells, so broader caching/composite-action policy remains outside this repair. Full CI is rerunning on this final head.

@fcostaoliveira

Copy link
Copy Markdown
Collaborator Author

Follow-up to the latest pass:

  • A failed readiness wait already records a permanent RLTest assertion failure; continuing cannot turn it into a passing racy-capture result. It also reaches the established INFO stop-marker/join path. A bare early return from these shared helpers would strand started monitors and return None to callers expecting a Counter. Secondary distribution diagnostics after failed startup can still be noisy; safely changing that requires coordinated lifecycle and caller-contract work, which is outside this focused ordering correction. The successful-ACK path now has the requested readiness guarantee in all three entrypoints.
  • The archive endpoint check and rationale are in the previous response: Bullseye security Release currently returns 404 from archive.debian.org, while the pinned snapshot and current main repository return 200. This repairs the observed security-package failure; it does not promise immunity from a later main-repository archival transition.
  • This high-range workload intentionally validates mixed-pattern plumbing and exact accounting. Its docstring describes the configured Z/S workload; the detailed comment explicitly says the low-range tests validate Zipf exponent/skew. Uniform R would not be reliably distinguishable in this narrow high-index range, which is precisely why the old pooled-correlation assertion was invalid. The new S/P comment now explains why clients repeat the prefix. The fixture uses 2 threads × 10 clients, not 50.
  • Both repaired platform cells are existing supported matrix entries. Retiring Bullseye or legacy OpenSSL needs a separate support-policy decision; this PR preserves them and validates their actual libraries. Composite-action extraction and caching remain optional maintenance work, not correctness requirements for this repair.

Current-head local module validation is 32/32. Remote CI has one pre-test StatsD download connection reset awaiting a targeted retry after its workflow completes; no implementation failure has appeared.

@fcostaoliveira
fcostaoliveira merged commit 2552312 into master Sep 20, 2026
163 of 164 checks passed
fcostaoliveira added a commit that referenced this pull request Oct 6, 2026
* Repair Bullseye packages and legacy OpenSSL CI builds

* Fix mixed Zipfian test oracle for clustered workloads

* Verify legacy CI linkage and guard malformed monitor captures

* Use portable awk regular expressions in legacy linkage checks

* Make linkage inspection failures explicit inside the loop

* Wait for MONITOR readiness in both Zipfian benchmark helpers

(cherry picked from commit 2552312)
@fcostaoliveira fcostaoliveira mentioned this pull request Oct 6, 2026
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.

1 participant