Repository navigation
Upgrade vendored HdrHistogram_c to 0.12.0 - #563
Conversation
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for this. I went through the non-vendored parts in detail and skimmed the amalgamation. A few comments below. On JSON compat, I checked the old local A few questions:
Nitpicking: the Makefile.am fixes for the Memcached headers and The integration itself looks solid to me. Keeping the clamp policy in (would file this as a comment, not a formal block) |
|
Addressed the first-pass review in d5f1ba4:
|
|
Follow-up on the provenance and hot-path questions for d5f1ba4:
No material regression is visible within this run's spread. This is a local Linux ARM64 sanity check in a shared four-vCPU Colima VM on an Apple M6; a fixed single-CPU Redis can limit throughput. It is not a cross-platform performance result or proof of equivalence. The upgrade binary's version stamp is b670072 because it was compiled before the subsequent documentation/Makefile-only commit. Reproduction script, provenance, all ten raw JSON results, CPU samples, and summary are committed in workspace commit 3648647. Summary · Provenance · Script. The old-toolchain question is covered by the configured distro smoke matrix and successful EL8 x86_64/aarch64 RPM builds noted above. Final latest-head CI result: 119 passed, 6 intentionally skipped, no failures or pending jobs at |
Upgrade the vendored HdrHistogram_c to 0.12.0, using the unmodified upstream core-plus-log amalgamation from commit
8885476fc83fa362fec2fb2b5e9cd9544514976e. Include release provenance and SHA-256 checksums for all eight vendored source/header files, verified automatically bymake check. Document the nullable JSON error result and update TSan suppression references.Preserve memtier's existing lower and upper latency clamping through a shared application wrapper; upstream's capped helpers permit zero. Replace the local encoding entry point with
hdr_log_encode, handle encoding errors in JSON output, and use the upstream percentile/count helpers. The Prometheus tests now exercise the production clamp wrapper instead of a duplicate implementation.Add compatibility coverage for boundary values, atomic recording, a histogram encoded by the previously vendored library, V2 round trips, and JSON/HDR-log agreement. Update source-distribution lists, including previously omitted Memcached headers and bash completion discovered by building the release archive. Packed storage and rolling windows remain follow-up work.
Validation:
Latest-head GitHub CI: 119 passed, 6 intentionally skipped, including ASan, TSan, UBSan, coverage, distro and RPM checks.
Linux ARM64 GCC 13: TLS-enabled default build and all four
make checkprograms pass.Source archive: build with
--disable-prometheus, all four unit programs, and vendored checksums pass.HDR, realtime latency, Prometheus and StatsD integration suites: 32/33 pass. The IPv6 exporter test fails with “no IPv6 announce”; the same isolated test also fails on unmodified master
2ed605f54b09ad6d38ed416663ab2d086a02b24cin this container.New JSON/HDR export integration test passes over both plaintext and TLS.
HDR compatibility tests pass under ASan+UBSan on Linux ARM64 and native macOS ARM64.
make format,make format-check, and the staged formatting hook pass. Vendored files retain upstream bytes, including upstream whitespace.Fresh upstream release download: archive SHA-256 and all eight vendored files match the upstream asset and manifest.
Five paired local Linux ARM64 TLS/pipeline-16 runs: median throughput −0.074%, client CPU/op +0.188%, within observed spread. Raw results, provenance, script and limitations.
Closes #561.
Note
Medium Risk
Touches the core latency histogram path and changes JSON histogram encoding, but behavior is guarded by new unit/integration tests and vendor checksum gates; wire format remains V2-compatible with prior exports per tests.
Overview
Upgrades vendored HdrHistogram_c from 0.11.0 to the upstream 0.12.0 core-plus-log amalgamation, with
SHA256SUMSand amake check/check-hdr-vendorstep so CI verifies the eight vendored files match the release asset.Latency recording and export move behind a new
latency_histogram.hwrapper (memtier_record_latency/_atomic) that keeps memtier’s lower-bound clamp (values belowlowest_discernible_valueare raised) while using upstream capped helpers and the renamed HDR API. All stats paths that recorded latencies now call the wrapper instead of inlinehdr_record_value_cappedlogic.JSON percentile output now embeds histograms via standard
hdr_log_encode(V2 compressed base64) instead of the removed localhdr_string_write; encode failures log to stderr and emit JSONnullforCompressed Histogram. README documents that field for consumers.Build and tests: adds
hdr_histogram_testand integration coverage (test_hdr_histogram.py) for V2 round-trips, legacy wire compatibility, and JSON vs.hgrmagreement; Prometheus unit tests use the same wrapper as production. Minor release packaging fixes (dist_completions_DATA, extra headers inEXTRA_DIST/ sources).Reviewed by Cursor Bugbot for commit d5f1ba4. Bugbot is set up for automated code reviews on this repo. Configure here.