Skip to content

Fix cache retry assert on ServerAddrSet#13396

Merged
ezelkow1 merged 1 commit into
apache:9.2.xfrom
ezelkow1:12972-92x
Jul 16, 2026
Merged

Fix cache retry assert on ServerAddrSet#13396
ezelkow1 merged 1 commit into
apache:9.2.xfrom
ezelkow1:12972-92x

Conversation

@ezelkow1

Copy link
Copy Markdown
Member

A TSHttpTxnServerAddrSet retry can re-enter the cache miss path after ATS already holds a cache write lock for the same request. The redirect-only prepared-write reuse logic then asserts because this is not actually a redirect.

Preserve the existing cache write lock when the retry returns through HandleCacheOpenReadMiss.

Backport of #12972 to 9.2.x. The accompanying autest is omitted because its plugin infrastructure (#12733) is not present on 9.2.x; enum and debug-macro names were adapted to the 9.2.x code.

Fixes: #12971

A TSHttpTxnServerAddrSet retry can re-enter the cache miss path after
ATS already holds a cache write lock for the same request. The
redirect-only prepared-write reuse logic then asserts because this is
not actually a redirect.

Preserve the existing cache write lock when the retry returns through
HandleCacheOpenReadMiss.

Backport of apache#12972 to 9.2.x. The accompanying autest is omitted because
its plugin infrastructure (apache#12733) is not present on 9.2.x; enum and
debug-macro names were adapted to the 9.2.x code.

Fixes: apache#12971
@ezelkow1 ezelkow1 added this to the 9.2.14 milestone Jul 16, 2026
@ezelkow1 ezelkow1 self-assigned this Jul 16, 2026
@ezelkow1
ezelkow1 requested a review from zwoop as a code owner July 16, 2026 17:48
@ezelkow1 ezelkow1 added the Backport Marked for backport for an LTS patch release label Jul 16, 2026
@ezelkow1
ezelkow1 requested a review from bneradt July 16, 2026 17:50
@github-project-automation github-project-automation Bot moved this from In progress to Ready to Merge in 9.2.x Branch and Release Jul 16, 2026
@ezelkow1
ezelkow1 merged commit 526ed6b into apache:9.2.x Jul 16, 2026
15 checks passed
@ezelkow1
ezelkow1 deleted the 12972-92x branch July 16, 2026 18:19

@bryancall bryancall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. This is a faithful backport of #12972: the condition, the branch placement before the terminal else, and the comment all match master, with the enum and debug-macro names correctly adapted to the 9.2.x code (CACHE_WL_SUCCESS, CACHE_DO_WRITE, TxnDebug). Verified those symbols exist on 9.2.x and that the new branch only fires on a re-entry after the write lock was already acquired, so first-miss behavior is unchanged.

Omitting the autest is the right call here since the plugin infrastructure from #12733 is not on 9.2.x. One request for the record: could you confirm you reproduced the original assertion from #12971 on a 9.2.x build and that it no longer fires with this change? Since CI cannot exercise this path on the branch, a note that it was validated manually would be good to have.

@ezelkow1 ezelkow1 moved this from Ready to Merge to Done for v9.2.x in 9.2.x Branch and Release Jul 16, 2026
@ezelkow1 ezelkow1 modified the milestones: 9.2.14, 9.2.15 Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Marked for backport for an LTS patch release

Projects

Status: Done for v9.2.x

Development

Successfully merging this pull request may close these issues.

3 participants