Skip to content

Fix two cache compatibility checks - #8

Merged
JakeChampion merged 3 commits into
10.2.xfrom
claude/cache-compat-fixes
Aug 22, 2026
Merged

JakeChampion merged 3 commits into
10.2.xfrom
claude/cache-compat-fixes

Conversation

@JakeChampion

Copy link
Copy Markdown
Owner

Draft. PR 3 of 4 — sits on #7. Prerequisite for the cache version bump in #5.

Two latent bugs in the cache compatibility path. Neither misbehaves today. Both are wrong in a way that only shows up once CACHE_DB_MINOR_VERSION moves, which makes them easy to trip over — #5 moves it, which is how they were found.

The HTTPInfo compat check is pinned to a moving constant

unmarshal_helper picks the legacy unmarshaller for anything older than the current version:

if (version < CACHE_DB_VERSION) {
  unmarshal_func = &HTTPInfo::unmarshal_v24_1;
}

CACHE_DB_VERSION is standing in for the 24.2 boundary, which is where HTTPInfo's marshalled layout actually changed (#4874). The two coincide right now, at 24.2, so it works.

Bump the minor version and they part: every existing 24.2 object then reads as "older than current" and goes down unmarshal_v24_1 — the wrong unmarshaller for its layout. Pinning the comparison to a fixed CACHE_DB_VERSION_HTTPINFO_V24_2 keeps it describing the one format change it is about.

The RAM cache skips the well-known-string fixup when compressed

load_http_info recomputes the WKS indices persisted in marshalled headers for objects written by an older version, and skipped anything from the RAM cache:

if (!this->f.doc_from_ram_cache && // ram cache is always already fixed up.
    ts::VersionNumber(doc->v_major, doc->v_minor) < CACHE_DB_VERSION) {

That comment does not hold when proxy.config.cache.ram_cache.compress is set. Compressed entries are stored still marshalled and decompressed into a fresh buffer on every hit, so alt->m_magic == MARSHALED again and the indices are stale again — the recompute has to run each time. The work stays bounded to objects written by an older version either way.

The consequence is subtle and only bites after a token-table change: field_find() on a cached header consults the wrong presence bit and slot accelerator, so a header reads as absent or as a different header entirely.

Builds and passes 172/172 unit tests standalone on this branch, without the version bump that motivated finding them.


Generated by Claude Code

claude added 3 commits August 22, 2026 09:29
The repository has no workflow that builds Traffic Server or runs its
tests, so changes get no automated verification on GitHub. Add one
covering the license audit, formatting, the build with its unit tests,
the end to end AuTests sharded four ways, and the documentation build.

Several choices are not obvious and are commented in the file. AuTests run
on the bare runner rather than in a container, because every
MakeATSProcess binds an IPv6 port and the Actions Docker bridge has IPv6
disabled; a preflight fails fast with a clear message otherwise. The build
is installed before ctest, because the plugin verification tests exec
traffic_server, which chdirs to the install prefix. nc comes from nmap
ncat, matching the Fedora images upstream uses, because accept_timeout
needs its -c to behave the way ncat's does. Cripts is enabled, because the
connection_exempt_list plugin is written in Cripts and tests that load it
fail at start up without it.

A failing test is retried once on its own before the shard fails, and both
the retry and the eventual pass are reported as warnings, so a genuinely
flaky test stays visible rather than being absorbed silently.

The http2 test is fixed here rather than separately, because without it
this workflow cannot be green on the platform it runs on. It built its
curl command with the bash only |& operator, and AuTest runs commands
through /bin/sh, which is bash on the Fedora images upstream uses but dash
on Ubuntu, where it fails to parse and curl never runs. The POSIX 2>&1 |
merges the streams the same way on both, and this was the only use of |&
in the test suite.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xp4ZMfVaT5EzvZsyMTx2y5
The exit status came from the failure counts parsed out of each worker's
output, and ignored the workers' own return codes. A worker that ran forty
tests and then died contributes no failures of its own, so the shard was
reported green having silently skipped whatever it had left to run. The
only existing backstop fires when a worker ran nothing at all.

Count the return codes too, and name the workers that exited non zero.
This matters most exactly when something has already gone wrong.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xp4ZMfVaT5EzvZsyMTx2y5
Neither of these misbehaves today. Both are wrong in a way that only
shows up once the cache minor version moves, which makes them easy to
trip over.

unmarshal_helper picks HTTPInfo::unmarshal_v24_1 for any object older
than CACHE_DB_VERSION. That constant is standing in for the 24.2
boundary, which is where HTTPInfo's marshalled layout actually changed.
The two happen to coincide right now. Bumping the minor version parts
them, and every existing object would then be read with the wrong
unmarshaller. Pin the comparison to the version it describes.

load_http_info recomputes the well known string indices persisted in
marshalled headers for objects written by an older version, and skipped
anything coming from the RAM cache on the grounds that it was already
fixed up. That does not hold when the RAM cache is compressed: those
entries are stored still marshalled and decompressed into a fresh buffer
on every hit, so the indices stay stale. The work is bounded to objects
written by an older version either way.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xp4ZMfVaT5EzvZsyMTx2y5
@JakeChampion
JakeChampion force-pushed the claude/autest-portability branch from 1cc0813 to b3ae2ff Compare August 22, 2026 09:29
@JakeChampion
JakeChampion force-pushed the claude/cache-compat-fixes branch from 14cb4b8 to 9e54faa Compare August 22, 2026 09:30
@JakeChampion
JakeChampion changed the base branch from claude/autest-portability to 10.2.x August 22, 2026 10:17
@JakeChampion
JakeChampion marked this pull request as ready for review August 22, 2026 10:17
@JakeChampion
JakeChampion merged commit 3d1fabc into 10.2.x Aug 22, 2026
8 checks passed
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.

2 participants