Both languages read the same values of TS_META_ADDR as no metaserver - #1343
Merged
Conversation
storage_backend::single_node calls itself the one implementation of that rule, and there is a second copy: matrixark_deployment_plan.META_SENTINELS holds the same five values in python. Nothing compared them - the python test checks that list against itself and no test under tools/ mentioned the rust constant at all. Drift already happened in the other direction: open_remote_store re-derived the rule with is_empty(), so a one-box setting TS_META_ADDR=local handed "local" to the client as a literal socket address and every write failed. This pins the copy that is left, in the language the compiler cannot check, and pins normalisation on both sides because the list is only half the rule. Verified to fail on a sixth spelling added to one list and on the trim/lowercase being removed, with a positive control so it cannot pass against a function that answers standalone to everything. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…he-same-sentinels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
storage_backend::single_nodesays of itself:There is a second copy.
matrixark_deployment_plan.META_SENTINELSis the same five values ofTS_META_ADDRin python —"",local,none,standalone,off— and nothing comparedthem. The python test checks that list against itself, and no test under
tools/mentioned therust constant at all, so the two could drift in either direction without a word.
Drift here is not hypothetical
It already happened, in the other direction.
matrixark_rust_proxy_impl::open_remote_storere-derived the rule with
is_empty()and got a narrower answer, so a one-box — which setsTS_META_ADDR=local— handed"local"to the client as a literal socket address:Every write failed, 123,435 of them in one soak, while the sample column read all zeros. That
call site now routes through
single_node()and carries the incident in a comment. This checksthe copy that is left — the one in another language, where the compiler cannot help.
What it pins
imported from
tools/), including its[&str; N]length annotation, so a list that grewwithout the annotation being updated is caught rather than silently trimmed.
value.trim().to_ascii_lowercase()and python compares_clean(...).lower(), so" Local "is a sentinel to both. Either side losing that is the same failure as either list changing —
a value one side calls standalone and the other hands over as an address.
The python half is driven, not read:
is_standalone()is called with the spellings a unitfile or a heredoc actually leaves (
" local ","LOCAL","\tOff\n","None","Standalone").It discriminates
Checked by perturbing each side and watching it fail, then restoring:
.trim().to_ascii_lowercase()removed from the rust comparison → fails naming that.There is a positive control (
10.0.0.4:17001must still read as a real address), without whichevery other assertion would pass against a function that answered "standalone" to everything.
And the readability of the constant is asserted first, since the comparisons would otherwise pass
on an empty tuple.
The normalisation check searches with
re.searchrather thanassertRegex, whose failuremessage prints the whole haystack — 45 KB of
storage_backend.rsto report that one line moved.No production code changes.
🤖 Generated with Claude Code