Repository navigation
[8.8-rse] [MOD-18951] Re-branch 8.8-rse from master - #11635
Conversation
The PR / merge-queue pipeline built both dependencies as steps inside the RediSearch build job. That serialized three independent builds onto one runner, and shipped the Redis install tree in the module artifact — which the unit-test job downloads but never unpacks. Split them into two sibling jobs, task-build-redis.yml and task-build-rejson.yml, each uploading its own artifact for the flow-test jobs to download. Both wrap the existing cached composite actions and run on the same resolved platform config and sanitizer flags as the module build, so the binaries stay ABI-compatible with it. Both artifacts are tarballs because the artifact zip drops Unix modes: redis-server has to stay executable, and Redis checks X_OK on a module file before loading it, so a 0644 rejson.so makes every server in the flow job fail to start.
…eck set (#10883) The monitor treated "at least one check reported and none pending" as the end of the run. For a minute or two after a push — and again after every force-push — `gh pr checks` reports only the fast PR-level checks, and all of those can already be pass/skipping while the pipeline has yet to register, so the loop declared a green run that had not started. This happened on #10882. Require the `pr-validation` gate to have been registered before an all-terminal payload counts. It `needs:` every other job, so its presence and terminal state imply the whole pipeline's, and there is no per-lane list to keep in sync. A stalled counter aborts after 20 such polls so renaming that job surfaces loudly instead of hanging the monitor.
…ng server (#10872) [MOD-15685] Refuse a legacy index spec RESTORE outside an RDB load A legacy index spec can only be upgraded while a load is in progress: both the UPGRADE_INDEX rules and the registry of legacy specs are built for the duration of a load and released at the end of it. IndexSpec_LegacyRdbLoad then looks both up unconditionally, so restoring a legacy ft_index0 payload on a running server reached dictFetchValue on a NULL dict and segfaulted. Any client holding RESTORE could do it. Refuse when either global is absent. The caller sees a load failure, which for RESTORE surfaces as a command error rather than a dead server. The check sits before anything is read, so a crafted payload needs no valid body to be rejected. Verified by removing the guard again: the server dies with the test reporting connection refused, so the test fails when the bug is present rather than passing for the wrong reason. This is MOD-15685 finding #71; #29 was fixed in #10817. Co-authored-by: Claude Opus 5 <[email protected]>
Move runes_to_key into string_utils as runes_to_bytes Lifts the rune-to-bytes conversion out of query_eval's expansion module into string_utils, so the trie wrappers can reach it too, and gives it the Result/RuneStrTooLong signature the rest of that module uses. The body still delegates to the C runesToStr; the pure-Rust reimplementation follows separately.
…d requests (#10877) * Introduce QueryRequest as base struct * Create CursorInfo struct and make it update that information * Add ChunkReplyState to QueryRequest and update field when needed * Create pipeline head (end proc) ptr and update it * Create syncing struct in QueryRequest, and update non-locking fields (TODO) * Add Active cycle flag (reaplcing bc pointer) * More cursor info * add Registory Node and update * Copy strictReadOwner and update * Copy RequestSyncState (seperated into 2 structs) and update * Remove RequestSyncState and consume from QueryRequest * Copy args meta into Query Request * Hold args in QueryREquest init and consume from QueryRequest * Mirror skiptimeoutchecks in QueryRequest * Consume from skiptimeoutchecks QueryRequest * Copy usereplycallback into QueryRequest * Consume usereplycallback from QueryRequest * Consume Registry info from QueryRequest * Consume Async from QueryRequest * Cosume reply from QueryRequest * Consume cursor Meta from QueryRequest * Copy refcount into QueryRequest * Consume refcount from QueryRequest * Remove BRC, move flifetime management to QueryRequest * Fix QueryRequest reply state cleanup * Remove legacy AREQ cursor id * Narrow QueryRequest argument helper * Make QueryRequest argument helper private * Keep QueryRequest opaque in Rust FFI * Expose QueryRequest fields required by Rust * Release aggregate request on profile parse error
…10820) * Review guidelines: bound automated re-review to the pushed delta Automated reviewers re-run a full review on every push, so a PR that is being iterated on draws a fresh round of findings from the churn of the previous round's fix. The loop has no fixed point: recent PRs have taken six rounds on the same hunk, each round critiquing the fix to the last, and one lost a human approval to the pushes that kept it going. State the terminating conditions on both sides. For the reviewer: ground every finding in a concrete failure, review only the delta since the last round, and hand a hunk that keeps drawing findings to the human reviewer instead of posting a third variation. For the author: batch a round into one push, treat reply-and-resolve as a complete response, and stop once a human has approved. Restate the same rules in .cursor/BUGBOT.md, which Bugbot reads on its own without loading AGENTS.md. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Review guidelines: close the gaps the first round left Five inconsistencies in the rules as written, all found by the Codex round on the PR that added them: - The two-round budget was unconditional, so a crash the confirmation round found in the first round's fix would be resolved with rationale instead of fixed. Exempt concrete failures and wrong fixes. - Delta-only re-review cannot apply to /adversarial-review: its follow-up rounds are deliberately blind to the earlier ones, so they have no previous head to diff against. Scope the section to reviewers that know what they reported last round. - Waiting for every reviewer to report had no exit: an app that is disabled, rate-limited, or failed never reports. Treat the round as settled after the expected reviewers report or ~20 minutes. - The grounding requirement overrode the explicit nits opt-in. Scope it to default review. - BUGBOT.md dropped the maintainability qualifier from the style rule, making Bugbot stricter than the spec it restates. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Review guidelines: exempt concrete failures on the reviewer side too The previous commit exempted concrete failures from the author-side two-round budget but left the reviewer-side rule unchanged, so "do not post a third variation in the same hunk" still suppressed a crash, memory-safety bug, or data loss found in a repeatedly edited hunk — the one case where the human reviewer most needs the failure scenario. Same exemption, same reasoning, now on both sides of the rule. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * BUGBOT.md: mirror the concrete-failure exception AGENTS.md exempts concrete failures from the same-hunk rule on both the reviewer and author sides, but the restatement in BUGBOT.md still told Bugbot not to report a third variation, without qualification. That file is deliberately standalone — Bugbot does not load AGENTS.md — so the omission would suppress a crash, memory-safety bug, or data loss found in a repeatedly edited hunk. Third and last copy of this rule; the exception now reads the same in all three places. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Review guidelines: drop the enumeration, carry the untrusted-input rule Two holes left by the previous commits, both in prose I added. The same-hunk exception enumerated crashes, memory-safety bugs, and data loss, while the scope it draws from also covers correctness, undefined behavior, ACL bypasses, races, and denial of service — so a deterministic wrong result in a repeatedly edited hunk stayed suppressed. Name the category instead of listing members: "concrete failure" is already pinned down by the grounding rule and the scope bullets, and a list that lives in two files is one more thing to drift. BUGBOT.md now tells Bugbot to inspect thread state, which gives it a reason to read commenter-controlled text, but omitted the rule that such text is untrusted. Carry over the untrusted-input and tool-usage safeguards, since that file is read without AGENTS.md. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Review guidelines: drop the author-side section, keep the reviewer rules Per review, remove § Responding to automated review. Everything under § Review guidelines is introduced by "When reviewing pull requests:", so five bullets telling the reader to batch a round into one commit and push it read as instructions to the reviewer — and Codex reads this file as the reviewer and can act on PRs. How an author paces their responses is not this file's business; what is left describes reviewer behavior only. Also hoist the concrete-failure exception to the top of § Re-reviewing after a push. Stated per-bullet it had to be repeated, and each copy left another rule — "do not reopen resolved threads" — able to bury a real defect. Stated once, it covers the section. BUGBOT.md gains the cross-reviewer duplicate rule: it had the rule for its own earlier findings but not for issues another reviewer already raised, which is exactly the churn two review apps on one PR produce. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * BUGBOT.md: point at AGENTS.md instead of restating it Per review, one source for the review rules. Every line this PR added to BUGBOT.md was a copy of an AGENTS.md rule, and the copies are what drove most of the churn on this PR: four of the five automated rounds reported a rule carried into one file but not the other. Replace the block with a reference and leave only the release-notes guidance, which is Bugbot's own. Whether Bugbot honours a reference to another file is unverified — it reads this one. Two things make that acceptable: it has posted nothing in this repo since June, so the exposure is theoretical and reversible, and the only omission with a security consequence cancels itself. The untrusted-input safeguard mattered because the re-review rules tell Bugbot to inspect thread state; a Bugbot that does not load those rules has no new reason to read commenter-controlled text. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Review guidelines: narrow the exception, spare coverage findings The hoisted exception swallowed the section it qualified. Every postable finding must already name a concrete failure, so "a concrete failure is always in scope, whatever the thread state" said every finding is always in scope, and delta-only review had no force left. The earlier per-bullet wording had the same hole in miniature — the defect is the breadth, not the placement. Limit the exception to defects that corrupt data, crash the server, break memory safety, or breach security, i.e. the top of the blast-radius ranking /adversarial-review already uses, and say the narrowness is deliberate so it does not get widened back. Separately, the grounding rule suppressed a finding two skills require: /rust-review's test-coverage check and /adversarial-review both mandate reporting new or changed behavior with no test exercising it, and untested working code has no failing input to name. A missing test is grounded by the gap itself. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Review guidelines: state the rule, drop "advisory" Per review, calling automated review advisory did no work beyond inviting findings to be waved off — a review app can find critical issues, and one found a real logic hole in these very rules. What the bullet is actually for is the mechanics: comment, do not request changes, and a human maintainer's approval is the merge gate. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…validate and resume (#10839) * rqe_iterators: keep exhaustion terminal across revalidate and resume An iterator that has run past its last result must stay past it until `rewind`. The trait says so, composites rely on it — a union drops children that report `at_eof`, `Intersection::revalidate` early-returns on `is_eof` — and `ContractChecker` asserts it. It was violated anyway. `RawInvIndIterator::revalidate` and `resume_in_place` both restore position with `rewind()` followed by `skip_to(last_doc_id)`. `rewind` clears `at_eos`, so for an iterator that was *at* EOF the re-seek finds the document it already yielded and it comes back reporting `at_eof() == false` and `Ok` — claiming its position never changed while EOF silently flipped. A composite that had dropped the child on EOF then re-admits it behind the position it has moved on to. `union_flat` and `union_heap` carry compensation code naming this exact cause: a workaround at the parent for a bug at the leaf. Capture `at_eos`/`last_doc_id`/`result.doc_id` before the rewind and restore the past-the-end position instead of re-seeking. The `rewind` itself has to stay: `ResumableReader::refresh_pointers` deliberately leaves the buffer pointer stale on the GC path because a rewind is coming, and `IndexReader::reset` is the only thing that refreshes `gc_marker`. Skipping the re-seek also skips the re-decode that would have rebuilt the result's borrowed offsets, so clear them explicitly — we only reach this after a GC cycle, and `RefreshOutcome::NeedsReseek` documents that an `RSOffsetSlice` borrowed from the old buffer does not survive one. The resume path already cleared them ahead of its own cast. A second defect surfaced from the same `rewind`: on a `Moved`-to-EOF the re-seek finds nothing, and `last_doc_id()` was left at the 0 the rewind wrote rather than the document the last yield left. Restored on that arm too, in both functions. `NotOptimized::revalidate` assigned rather than latched its EOF flag, so a wildcard that recovered documents could revive it. Latched now, with `past_end` folded into the guard — `read` recomputes `past_end` from `read_inner`, so latching that alone would be dropped on the next read. Defensive rather than a reachable bug with today's wildcards, but `W` also admits `CRQEIterator` wrapping a C implementation. Why this was not already caught: `revalidate_at_eof` revalidated without dirtying the index, so `needs_revalidation()` was false and `revalidate` returned before reaching the `rewind`. The new `revalidate_at_eof_after_gc` removes a document first, across all five inverted-index leaves, on both the revalidate and resume paths. `ContractChecker` covers the `RQEIterator` surface but not suspend/resume, so the cross-cycle guarantees now sit in `revalidate_via_resume`, the single funnel every resume test goes through. The union compensation stays: with `QUICK_EXIT` laggers are intrinsic to the mode, and a full union can still see one from a child that breaks the contract, which `revalidate_resurrected_child_does_not_drag_a_full_union_backwards` covers deliberately. Only the comments are retargeted. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * rqe_iterators: assert the exhaustion contract rather than restating it Review follow-ups on the exhaustion-is-terminal change: - Move the contract text onto `RQEIterator::at_eof`, which the citations added in core.rs, not_optimized.rs and both unions already pointed at; `revalidate` keeps only the re-seek trap, and `resume` links to both. - A full union now `debug_assert!`s that no child lands behind its position instead of quietly recovering: children are covered by flow tests and the disk iterators run our suite, so a violation is a bug to surface, not a case to absorb. The recovery stays for release builds. The resurrection test asserts the panic instead of the compensation. - Trim the rationale restated at the three restore sites down to what each one owns locally. - Assert that a restored exhausted leaf stays exhausted on a read, on both the revalidate and resume paths - the flags and the rewound reader are two mechanisms and only a read proves they agree. - `debug_assert!` that the re-seek's `Moved` arm carries a current, so a `None` cannot quietly downgrade it to 'exhausted'. * rqe_iterators: correct two stale comments flagged in review - `union_flat::revalidate` justified revalidating exhausted children by claiming they may become active again. That is what this branch abolishes: they are revalidated because they still hold index references and an aborted one has to be removed, not because they can come back. - The `NotOptimized` latch did not say when `forced_eof` and `wcii.at_eof()` disagree. They do whenever `max_doc_id` closed the window with the wildcard still live on a document, which `skip_to` sets in two places and the read loop in a third - so assigning cleared a flag set for an unrelated reason. Name that, and say which of the two guards covers which call. * rqe_iterators: cover the reachable NotOptimized resurrection The existing latch test reaches it through a contract-violating mock, which left the impression the latch was hardening. It is not: `skip_to` past `max_doc_id` ends the iterator without touching the wildcard, so a wildcard that later moves forward under GC - all a conforming one ever does - made the old assignment clear `forced_eof`, and the next `read` resumed an iterator that had already reported it was done. Red before green: with the assignment restored, ContractChecker fails the new test with 'an exhausted iterator must keep returning None, but it yielded doc 60'. * rqe_iterators: fold NotOptimized's two EOF flags into one `forced_eof` and `past_end` recorded overlapping facts, which is what made the latch hard to read: every site setting `forced_eof` also left `past_end` set, and where `past_end` was set alone it was because the position had reached `max_doc_id`, which `has_next`'s second term already catches. So `past_end` latched - cleared only by `rewind`, as exhaustion being terminal requires - covers both roles, and `forced_eof` goes. `read_inner` now owns the invariant that every `Ok(false)` leaves `past_end` set, so `read`/`skip_to` relay its answer instead of re-deriving one. That also retires `skip_to`'s `past_end = false`, which could only ever have run when the flag was already clear. `OptionalOptimized` has always been built this way; this brings the two siblings back into line. No behaviour change: breaking the latch still fails the same two tests, and only those. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
A crash report, and the log lines interleaved with it while the crash
handler runs, can contain raw memory bytes. `test_crash` and
`test_tracing` read the server log with the default strict UTF-8 decode,
so a single invalid byte anywhere in the file raises UnicodeDecodeError
and errors the test out before it can check anything:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position
3286: invalid start byte
Both only match ASCII fragments, so decode lossily and pin the encoding
rather than inheriting it from the locale.
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…gv re-scan (#10566) * FT.HYBRID: forward PARAMS/TIMEOUT from parsed state, not argv re-scan * Revert initQueryTimeout() changes * Add HYBRID_NUM_BUF_SIZE constant, address SonarQube comments int test_cpp_hybrid_build_mr_cmd.cpp * Refactor HybridRequest_buildMRCommand to use HybridShardWireParams * Assert HybridCombineWireParams is not NULL in MRCommand_appendCombine
* [MOD-14883] string_utils: share the libnu read-ahead model out of rs_token rs_token pads around libnu's decoder because that decoder reads ahead past the end of a sequence, and the model of how far it can read — NU_MAX_READAHEAD, nu_seq_len, tail_may_overread — has lived in rs_token as private items. The fuzzy walk added next has to hand bytes to the same decoder and so needs the same guards. Move them into string_utils::libnu and have rs_token use them from there, so the two callers share one copy: a second copy is one a later fix to the first would leave behind, and being wrong about how far the decoder reads is a read past the end of a buffer. No behaviour change — the items are the same, only their home is. * [MOD-14883] c_trie: add iterate_fuzzy walk over the terms trie The QN_FUZZY port needs the trie's edit-distance walk from Rust. Wrap the Trie_IterateFuzzy / TrieIterator_Next / TrieIterator_Free pull loop inside c_trie and hand each match to a callback, matching the shape of the iterate_contains and iterate_suffix walks already there. The pattern is passed as raw token bytes rather than runes: Trie_IterateFuzzy lowercases and decodes them itself, and it is also where the TRIE_MAX_PREFIX length limit is applied. A pattern over that limit starts no walk, which the returned FuzzyWalk reports separately from a walk that ran and matched nothing — the caller has to yield no iterator for the first and an empty union for the second, so the two must not collapse. The per-match edit distance and payload out-params are passed as null, which both the iterator and the edit-distance filter check for before writing. Folding the pattern goes through libnu's decoder, so the read-ahead guards shared out of rs_token in the previous change are used here rather than copied. The distance is taken as a FuzzyDistance rather than a bare int. It reaches C as the size of a stack variable-length array, so a negative one is a negative-length allocation and a large one exhausts the stack before the walk starts — neither is something a caller can check for afterwards. C bounds it at the entry points instead, structurally in the grammar and against MAX_LEV_DISTANCE when FT.SPELLCHECK is parsed; a public Rust wrapper is the first place the value can arrive unbounded, so the type carries the bound. * [MOD-14883] levenshtein: make MAX_LEV_DISTANCE the shared edit-distance bound The largest edit distance an automaton can be built for was spelled twice: as a bare 4 inside SpellCheckCommand in module.c, and again as FuzzyDistance::MAX in the Rust c_trie wrapper. Nothing linked the two, so raising one would leave FT.SPELLCHECK accepting a distance the wrapper refuses. Move the constant to trie/levenshtein.h, next to the SparseAutomaton whose stack VLA is what actually bounds it, and have both the command parser and FuzzyDistance::MAX read it from there. * [MOD-14883] c_trie: check the fuzzy distance in iterate_fuzzy itself FuzzyDistance made an out-of-range edit distance unrepresentable, but every caller had to construct one first and every test had to wrap its literal, for a range check that only ever mattered at one call site. Drop the type and take the distance as the i32 it already travels at, checked before anything reaches the automaton. InvalidFuzzyDistance stays and is now returned by iterate_fuzzy, so the walk answers with a Result whose Err arm is the same refusal the type used to encode.
…t parallelism (#10499) * Limit parallel workers to 6 for macOS x86_64 CI * Limit parallel workers to 6 for macOS 26 x86_64 CI * macOS 26 x86_64 environment: use 'macos-26-intel' instead of 'macos-26-large' * Revert "macOS 26 x86_64 environment: use 'macos-26-intel' instead of 'macos-26-large'" This reverts commit bbecac5. * Revert "CI: skip macOS Intel (x86_64) test runners; keep macOS ARM (#10463)" This reverts commit 1932d4e. * Limit parallel workers for coordinator tests on macOS 26 x86_64: virtual_cores/SHARDS * Limit parallel workers to physical cores for macOS 26 x86_64 CI * CI: retain both matrix exclusion formats in generate-matrix * Revert workflows changes
) * [CI] Make Rust module panics visible to failure-context triage `ci-failure-context` highlighted `panicked at`, std's default panic hook format. A loaded RediSearch module replaces that hook in `RustPanicHook_Init`, so its panics read `A panic occurred in the Rust code panic.payload=... panic.location=...` and never matched. Every module-level Rust panic was therefore excluded from the KEY FAILURE LINES banner and left to survive the tail-cap on its own. Add that signature plus `crashed by signal:`, and normalize redis-server log prefixes and hex addresses out of the dedupe key so N repetitions of one crash collapse to a single entry instead of consuming N of the `max-key-lines` slots. Co-Authored-By: Claude Opus 5 <[email protected]> * [CI] Correct the panic-hook note and tighten the redis-prefix dedupe `RustPanicHook_Init` chains its `tracing` hook ahead of std's rather than replacing it, so a module panic emits both spellings. What decides which one reaches these patterns is routing, not hook installation: `tracing` goes through `RedisModule_Log` into the redis logfile that gets collected, while std's `panicked at` goes to a stderr pipe RLTest never reads. The redis-prefix dedupe pattern accepted any word where the month belongs, so an unanchored match could land mid-message and merge two distinct `[FAIL]` lines that differed only in such a span. Spell the month out. Anchoring is not an option — the console copy of a redis line carries an ANSI colour escape ahead of the prefix. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
…nd trip (#10912) * Add characterization tests for `StopWordList` fold, order and RDB round trip `StopWordList` has observable behaviour that no test pinned: case folding truncates a term at an embedded NUL and mangles invalid UTF-8 rather than rejecting it, the `INFO` field renders in lexicographic rather than insertion order, and an RDB save/load pair is expected to be an identity on both the stored key bytes and their order. The two folding tests assert that the add path and the lookup path transform a term identically, rather than asserting a predicted output, so they pin the property callers depend on without hard-coding the decoder's arbitrary mapping for invalid input. `testStopWordListRdbLoadTruncated` covers the load failure that happens after the list already holds an entry, which the existing `testStopWordListRdbLoadExceedsLimit` does not reach because it bails before allocating anything. Co-Authored-By: Claude Opus 5 <[email protected]> * Use a one-byte prefix probe in `testStopwordListEmbeddedNul` `codespell` reads the two-byte prefix `"fo"` as a misspelling of `of`/`for`, failing the spellcheck job. Any proper prefix of the stored key demonstrates the same thing, and suppressing the word repo-wide would cost more than it buys. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
Move TermsTrie and SuffixTrie into their own modules
* [MOD-17464] Document mistaken PR cleanup workflow * [MOD-17464] Add focused close-pr skill * [MOD-17464] Clarify close-pr closure modes * [MOD-17464] Harden PR cleanup safety guidance * [MOD-17464] Require approval for branch deletion * [MOD-17464] Clarify metadata cleanup verification * [MOD-17464] Check PR state before cleanup rewrite
…layer (#10933) * [MOD-17606] Pass the vector field's schema index to the disk storage layer The disk storage layer can keep several of an index's vector fields in one physical store, in which case it needs a fixed-width identifier per field to keep their keys apart. The field name it already receives is variable-width, so it is a poor fit for that. `VecSimDiskContext` gains an opaque `userData` slot for exactly this kind of pass-through (see the VectorSimilarity bump), and both places that build a field's disk context fill it with `fs->index`. That is the natural choice: the field index is unique per field regardless of type, sequential from 0, and restored in the same order on RDB load, so it is stable across a restart — which is also why the disk layer already keys its TAG and NUMERIC storage by it. * Track the reviewed VecSimDiskContext layout Review on VectorSimilarity#1013 narrowed userData to uint32_t and moved it ahead of rerank so the struct's fields run widest-first, which keeps VecSimDiskContext at 32 bytes. Bump deps/VectorSimilarity to that commit and set userData before rerank here to match: C is indifferent to designated-initializer order, but C++20 is not, and keeping the two in step avoids a trap for the next caller. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Repoint deps/VectorSimilarity at upstream main RedisAI/VectorSimilarity#1013 has merged, so the gitlink no longer has to reference a fork branch that CI cannot fetch. Pin the squash commit on main instead; the header content is identical to the fork commit it replaces. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…<version>` range (#10589) * Improve agentic backport flows: all labels + reviewer-feedback resolution Two enhancements to the Codex-driven backport workflows: 1. Honor all backport labels (create flow). A `pull_request_target: labeled` event now resolves every matching `backport-<branch>-agent` label on the PR (unioned with the just-fired label as an eventual-consistency guard) instead of only the label that fired. Adding several labels at once previously dropped targets, because GitHub's per-PR concurrency keeps only the latest pending run and cancels the intermediates. The agent's per-target idempotency makes re-processing an already-handled label a no-op. 2. Resolve reviewer feedback (fix flow). Alongside a CI-failure fix, the agent now ingests write-level (OWNER/MEMBER/COLLABORATOR) reviewer feedback: unresolved inline review threads (replied to and marked resolved via the addPullRequestReviewThreadReply/resolveReviewThread GraphQL mutations) and general PR comments (replied to). Bot summaries and /backport-agent* command comments are filtered out to avoid feedback loops. The prompt's trust model is extended so only these workflow-filtered fields are actionable; all other comment text stays untrusted evidence. Adds a stdlib unittest suite (scripts/auto_backport/tests/test_resolve.py) covering the label-resolution and reviewer-feedback filtering logic. Co-Authored-By: Claude Opus 4.8 <[email protected]> * Address Codex review + validate targets - resolve_create: restore the label fallback for a plain `/backport-agent` comment (no args) — my earlier refactor gated the label scan to pull_request_target events, so a no-arg comment resolved nothing. Also validate every resolved target against a release-branch shape (TARGET_RE), dropping malformed comment tokens / mis-provisioned labels with a log line instead of feeding them into branch-name construction. - resolve_fix: paginate reviewThreads (was capped at the first 100); collect top-level PR review bodies (e.g. "Request changes" with no inline comment), which are neither issue comments nor review threads; give general comments an `id` and bound both general comments and review bodies to feedback newer than the last bot fix attempt, and skip review threads whose latest comment is the bot's own reply — so repeated /backport-agent-fix runs don't re-reply to already-handled feedback. - common: gh_graphql omits None-valued variables so a nullable cursor resolves to null on the first page. - prompt + tests updated accordingly. Co-Authored-By: Claude Opus 4.8 <[email protected]> * Add `/backport-agent >= <version>` range form Backporting a fix usually means "this release line and everything newer", which until now had to be spelled out branch by branch. `/backport-agent >= 2.10` now expands to every active release branch at or above 2.10 (2.10, 8.2, 8.4, 8.6, 8.6-rse, 8.8, 8.8-rse, 8.10). Forms can be mixed: `/backport-agent >= 8.8 2.10`. The list of live release lines lives in .github/release-branches.json. It is explicit rather than derived from the remote's branches because the repo carries MAJOR.MINOR-shaped branches that are not release lines (9.6 is a test dummy, 99.88 is an internal version bump) plus long-EOL lines, and a pattern sweep would open backport PRs against all of them. The branch-out-release skill now owns keeping it current, alongside creating the backport labels. Comparison is numeric, not lexical, so `>= 8.9` includes 8.10. A floor that expands to nothing does not fall back to the PR's labels: the comment stated an explicit intent, so resolving nothing and skipping beats backporting somewhere the requester did not ask for. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Address review feedback: release branches 2.6/2.8 + resolve_fix hardening - release-branches.json: add the active 2.6 and 2.8 lines (GuyAv46) and drop them from the EOL note in the header comment. - resolve_fix: harden the reviewer-feedback collectors against the Codex P2 findings: * cutoff marker now must be authored by BOT_LOGIN and match the exact "applied" prefix, so a forged marker or a declined summary can't move the cutoff and hide unaddressed feedback (renamed last_applied_fix_timestamp); * review-thread comments fetched with `last:100` so the "bot already replied" check sees the genuine latest comment on >100-comment threads; * a thread qualifies on any trusted comment, not only a trusted root, so a maintainer's reply on an externally-opened thread is kept; * threads whose latest comment is the bot's own reply are surfaced flagged `bot_replied_last` (resolution-only: retry resolve, no duplicate reply) instead of being skipped forever; * DISMISSED/PENDING review bodies are excluded so withdrawn feedback isn't acted on. - prompt: document `bot_replied_last` and the resolution-only handling. - tests updated; 40 pass. Co-Authored-By: Claude Opus 4.8 <[email protected]> * Fix spellcheck + per-item reviewer-feedback acknowledgement - resolve_create: "unparseable" -> "unparsable" (codespell failure). - resolve_fix: replace the coarse last-applied-fix timestamp cutoff with per-item acknowledgement. The bot now embeds a `<!-- backport-agent-addressed: <kind>:<id> -->` marker in each reply, and addressed_feedback_ids() reads those markers back (bot-authored only) so a repeated /backport-agent-fix run filters out exactly the general comments / review bodies it already replied to — feedback an applied fix left open or failed to reply to is preserved rather than silently dropped once an "applied" summary is posted. pr_comments entries carry `kind` + `id`. - prompt: stamp the acknowledgement marker on general-comment/review-body replies; document the marker and the kind/id identity. - tests updated (39 pass), incl. per-item drop + marker parsing. Co-Authored-By: Claude Opus 4.8 <[email protected]> * resolve_fix: edit-aware acknowledgement + author-based bot filter Two Codex P2 edge cases in the per-item feedback dedup: - Edited comments were suppressed forever: the `comment:<id>` marker persists across edits, so a maintainer editing a comment after the bot replied kept the revised feedback hidden. addressed_feedback() now records the timestamp of the acknowledging bot reply, and fetch_general_pr_comments re-surfaces a comment whose `updated_at` moved past that ack. (Reviews expose no edit time, so they remain presence-suppressed.) - Bot filtering was content-based: dropping any comment starting with `🤖 Auto-backport`/`🤖 Re:` also dropped a maintainer's comment quoting the bot's heading. Now the bot is excluded by author (== BOT_LOGIN); only the `/backport-agent*` slash-command prefix is still filtered by prose. Tests updated (40 pass): author-not-prose bot filter, edit-resurfacing, and marker→latest-ack-timestamp mapping. Co-Authored-By: Claude Opus 4.8 <[email protected]> * resolve_fix: drop superseded reviews + guard thread resolution against races - fetch_review_bodies now drops a review body when the same author later submitted an APPROVED review (GitHub keeps the superseded record un-dismissed), so a request-changes withdrawn by a later approval no longer reaches the agent. A request-changes submitted *after* an approval (fresh round) is newer and kept. Needs state + submitted_at, so empty-body approvals are fetched too (they still supersede). - review-thread snapshots carry latest_comment_at (max comment createdAt); the prompt re-checks the live thread before resolving and skips the resolve if a newer non-bot comment arrived after the snapshot, so a reviewer follow-up is never auto-closed unseen. Same guard applied to the bot_replied_last retry. - tests: 43 pass (supersede drop/keep, latest_comment_at). Co-Authored-By: Claude Opus 4.8 <[email protected]> * resolve_fix/create: robustness — bot-reply vs trusted, bound context, cap versions Three Codex P2 edge cases: - bot_replied_last now means "the bot replied after the latest *trusted* comment", not "the bot is the thread's final commenter". A trailing untrusted or unrelated-bot comment no longer flips it off (which had made the next run re-address + re-reply); a new trusted comment after the bot's reply still reopens the thread as actionable. - reviewer feedback handed to the agent is now bounded: each body is clipped to MAX_FEEDBACK_BODY_CHARS and each list to the newest MAX_FEEDBACK_ITEMS, so a PR with many/huge trusted comments (pasted logs) can't overflow the Codex step's input before it fixes CI. - resolve_create: bound version components to {1,4} digits in TARGET_RE/FLOOR_RE so a floor like `>=<5000 digits>.1` is rejected as malformed instead of tripping int()'s digit limit in version_key and aborting the whole resolve step (dropping valid siblings). Tests: 48 pass. Co-Authored-By: Claude Opus 4.8 <[email protected]> * resolve_fix: reject bot-authored feedback regardless of association Security hardening (P1): the reviewer-feedback trust gate was association-only, so a review bot or machine account carrying MEMBER/COLLABORATOR would have its text admitted into review_threads[]/pr_comments[] and treated as actionable human feedback by an agent holding contents+workflows write — a prompt-injection path that excluding only redis-pr-app[bot] did not close. Now reject any Bot-typed author independent of association: - review-thread comments: query author __typename and drop `Bot` authors; - general comments + review bodies: add `.user.type != "Bot"` to the jq. Tests: 50 pass (MEMBER-associated bot dropped; jq carries the type filter). Co-Authored-By: Claude Opus 4.8 <[email protected]> * resolve_fix: apply the human-trust predicate to the bot_replied_last index math Completeness fix for the prior bot-author exclusion: `bodies` dropped Bot-typed authors, but `last_trusted_idx` still counted them, so a Bot-typed MEMBER/COLLABORATOR commenting after the backport bot's reply advanced last_trusted_idx past last_bot_idx and flipped bot_replied_last false — making a later run re-address the old human feedback and post a duplicate reply. Factor the trust check into one `_is_trusted_human()` used by both the body list and the index math so they can't drift again. Tests: 51 pass. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
…10071) * [MOD-16215] hybrid: lock the spec once for single-threaded execution The single-threaded hybrid path (WORKERS 0) built its pipeline without the spec read lock, while the background path took it in HREQ_Execute_Callback. QAST_Iterate consults the trie/stats and SearchCtx_TakeDiskSnapshot documents the lock as a precondition, so the unlocked build races with GC. Move the lock into buildPipelineAndExecute so both paths acquire it in one place, and take it exactly once per execution. Every sub-request has its own RedisSearchCtx but they all share the spec's rwlock, which is writer-preferring and non-recursive: letting the sub-request iterators re-acquire it during an inline depletion would deadlock on this thread against a queued writer such as fork-GC. So the foreground in-memory path marks the sub-request contexts as borrowing the lock (SPEC_LOCK_READ_BORROWED) - they read the spec but never touch the rwlock, and skip revalidation since the lock was never dropped. The lock is therefore held across the whole depletion, giving the single-threaded path the same consistent index snapshot the background path gets from the RPSafeDepleter handoff. Foreground disk specs release the lock after the build instead: their iterators read from the snapshot taken during the build, so holding it across disk IO would only block writers. This replaces the earlier approach on this branch, which released the lock before foreground depletion and let each iterator re-lock; it addresses the review request to lock the index once and keep it until execution finishes. Failures now funnel through a single `error:` label, so a future early return cannot leak the lock. * hybrid: add foreground spec-lock coverage; fold the borrow guard Addresses the review asks on the lock-once change. Tests (tests/pytests/test_hybrid_foreground_lock.py): the foreground path must always release the read lock, and a leaked one is silent until the next writer, so each case is followed by a forced GC that needs the write lock. Covers a successful non-cursor query, the internal WITHCURSOR path (user-facing FT.HYBRID WITHCURSOR is rejected at the public boundary, so the cursor path is only reachable via _FT.HYBRID), the two pre-borrow error exits, and the cursor-limit failure - which is the error exit taken *after* the sub-requests borrowed the lock. A GC-churn test then checks results stay coherent while GC mutates the trie between queries. Not covered, and called out in the file docstring: the interleaving where a writer queues on the rwlock while the query holds the read lock and before a sub-request's first read. It is not deterministically reachable at WORKERS 0 - the main thread is inside the query so no client can drive a sync point, and fork-GC has no sync point at its write-lock acquisition. The churn test reaches for it opportunistically. Also folds the `borrowedByRequests` check into returnBorrowedSpecReadLocks so both exits read as a single call. * hybrid: rename the borrowed-lock helpers, drop a redundant comment Review feedback on #10071: a void function whose name starts with "return" reads like a return statement. The pair is a marker handoff, not a lock operation, so name the clearing side for what it does. RedisSearchCtx_ReturnSpecReadLock -> RedisSearchCtx_ClearBorrowedSpecReadLock returnBorrowedSpecReadLocks -> clearBorrowedSpecReadLocks Also drops the lock comment in HREQ_Execute_Callback, which restated what buildPipelineAndExecute already documents. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * hybrid: add a deterministic foreground spec-lock regression test Review feedback on #10071: the existing coverage pinned the borrow protocol but passed on master too, so it was not a regression test. This adds one that fails if the foreground build stops holding the spec read lock. The discriminating window is the pipeline build alone - during depletion the sub-request iterators take the lock themselves on either side of the fix, so the timing is identical there. Observing that window needs a writer running while the main thread is inside the query, and no command can release either side, because the main thread is exactly what is parked. So both parks release themselves: * fork-GC's term apply parks after the fork, just short of the spec write lock, until a foreground hybrid build is parked (SyncPoint_WaitUntilOnce predicate), and again once it holds the lock, on a short window. * the foreground build parks with the read lock taken until GC reports it holds the write lock, on a long window. The query's own elapsed time is then the oracle: with the read lock held GC never gets in, so the build runs out its full window; without it GC takes the write lock at once and the build resumes immediately. Verified both ways - 3000ms with the lock, 3ms with the RedisSearchCtx_LockSpecRead call reverted. SyncPoint_WaitUntilOnce is new: WaitUntil ignores the arm's auto-release window, which would park the main thread forever in the green case, and the term apply runs per term so the park has to be single-shot. Also replaces the vacuous assertTrue(True) in the writer check with the forced GC's actual reply, and corrects the claim that a leaked read lock hangs - the blocked client times out and replies with an error. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * hybrid: assert recorded state, not elapsed time, in the spec-lock tests Two Codex findings on the tests added earlier, both real. The regression test used the query's elapsed time as its only oracle, on the "slow means the lock was held" reading. That cannot produce a false failure, but a host stall can push the unlocked path past the threshold and let a real regression pass. SyncPoint_WaitUntilOnce now records how the park ended - SIGNAL, PREDICATE or TIMEOUT - exposed as FT.DEBUG SYNC_POINT LAST_EXIT. The test asserts TIMEOUT on the build park: the predicate firing means GC reached the write lock while the build was in progress, which is exactly the regression. Elapsed time is kept only as a diagnostic in the failure message. The release probe was vacuous wherever the test deleted nothing. The spec write lock is only taken per collected term or tag, and FGC_parentHandleTerms returns at its terminator when the child sent no delta, so a cycle with nothing to collect never takes it - GC_FORCEINVOKE replies DONE whether or not the read lock leaked. Measured with the new LAST_EXIT probe: with no seeded deletion GC never reaches the post-write-lock site (NONE), with one it does (TIMEOUT). The helper now creates and deletes a probe doc first, so every probe has a writer to block. Kept the forced GC rather than switching to FT.ALTER, which the review suggested: FT.ALTER takes the write lock on the main thread, so a leaked read lock would wedge the server into a test-framework timeout instead of failing with a diagnostic. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * debug: fold the three SyncPoint wait loops into one park SyncPoint_Wait, SyncPoint_WaitUntil and SyncPoint_WaitUntilOnce were three copies of the same spin loop. They now share SyncPoint_Park and differ only in what they pass it, so each public entry point is one line. This also settles an inconsistency that WaitUntilOnce was invented to work around: Wait honoured the arm's auto-release window and WaitUntil silently ignored it, so arming a WaitUntil point with a timeout did nothing. Every ARM-with-timeout call site in the suite is a Wait point, so no test changes behaviour. WaitUntilOnce now differs from WaitUntil only by disarming on exit. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * hybrid: give buildPipelineAndExecute a single exit for the spec lock The success and error epilogues did the same two things, and a mutable borrowedByRequests flag tracked state that already lives on the sub-request contexts. Both exits now funnel through one `done:` block, and whether the sub-requests borrow the lock is a const bool derived from the inputs. Cleanup still has to be gated on that predicate rather than run unconditionally: on the background path the sub-request contexts are locked by other worker threads during depletion, so reading their lock_state from this thread would race. ClearBorrowedSpecReadLock is now a no-op on a context that never borrowed, so the build-failure exit can share the same epilogue while the assert still catches clearing a genuinely held lock. Also splits the borrow bookkeeping into borrowSpecReadLocks / returnSpecReadLocks, so neither helper opens with a bare return. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * hybrid: trim the spec-lock comments and test setup Cuts restated prose down to the facts a maintainer cannot infer, per the comment guidelines, and drops two pieces of dead weight from the test file: a NUMERIC field no query touches and a _blob parameter never passed. No test logic changes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * hybrid: check writer exclusion in the build instead of racing fork-GC The regression test needed a writer running concurrently with the foreground build, which at WORKERS 0 meant sync points inside fork-GC's term apply: the main thread is parked in the query, so no command can release either side and both parks had to self-release. That cost two sync points in the GC write path, a third in the build, SyncPoint_WaitUntilOnce, a recorded exit reason and a LAST_EXIT debug subcommand - and it put test scaffolding in the GC. None of it is needed to check the property. pthread_rwlock_trywrlock cannot block and fails with EBUSY while any thread holds the lock, this one included for read, so the build can simply ask whether a writer could get in. RedisSearchCtx_AssertWritersExcluded does that and aborts if the answer is yes. The oracle is stronger as a result: it tests the rwlock rather than our own lock_state bookkeeping, no second thread has to be scheduled, and there is no window for a loaded host to distort. It also covers the background path and every other hybrid test in the suite rather than one bespoke test. debug_commands.c/h and fork_gc/terms.c are no longer touched by this PR. Verified both ways: removing the RedisSearchCtx_LockSpecRead call fails all 5 tests in test_hybrid_foreground_lock.py with "a writer could take the spec lock here" in the server log; restored, 367 tests pass across the hybrid suite, test_gc.py, test_multithread.py, test_aggregate_barrier.py and test_debug_commands.py. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * hybrid: drop the spec-lock tests, keep the fix Removes tests/pytests/test_hybrid_foreground_lock.py and the RedisSearchCtx_AssertWritersExcluded helper it existed to drive. What remains is the fix itself: buildPipelineAndExecute takes the spec read lock for both execution paths and lends it to the sub-request contexts across foreground in-memory depletion. Proving writer exclusion at WORKERS 0 needs a writer running while the main thread is parked inside the query, and every way to arrange that costs more scaffolding than the fix. Not worth it here. The change stays covered indirectly: flow tests default to WORKERS 0, so the borrowed-lock path is what the whole hybrid suite exercises, and test_hybrid_multithread.py covers the background path where the lock moved out of HREQ_Execute_Callback. 362 tests pass across the hybrid suite, test_gc.py, test_multithread.py, test_aggregate_barrier.py and test_debug_commands.py. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…10948) Make the debug hybrid request consume its search context on every path HybridRequest_Debug_New freed the sctx through the hybrid request on its parse- and pipeline-build-failure paths (HybridRequest_Free frees hreq->sctx), yet the handler freed the same pointer again on the NULL return — a double free reachable with a malformed hybrid query and a valid DEBUG_PARAMS_COUNT under enable-debug-command. The comment claiming the inner call "doesn't free it on error" was wrong. The contract is now uniform: HybridRequest_Debug_New consumes sctx on every path — the one pre-container failure (invalid DEBUG_PARAMS_COUNT) frees it directly, the rest free it through the request — and the handler stops freeing on NULL. Fixes MOD-17665. Co-authored-by: Claude Fable 5 <[email protected]>
…uction code (#10927) Remove `keysDict` null-handling test workaround from production code Remove the production revalidation guard that existed solely to accommodate an incomplete C++ test mock. Initialize and populate the mock keys dictionary in `testHybridVector` so the test exercises the production lookup path instead.
R2 (NotOptimized): implement RQEIteratorBoxed + RQESuspendedIterator
R2 (UnionTrimmed): refuse the RQEIteratorBoxed/RQESuspendedIterator transitions for UnionTrimmed
* Wrap reads of RSGlobalConfig in a safe global_config crate Rust code that wants a RediSearch setting has to read the RSGlobalConfig extern static, which is unsafe at every call site. Six such reads had grown across four crates, each carrying its own safety argument, and those arguments disagreed with src/config.c: numericCompress, prioritizeIntersectUnionChildren and maxAggregateResults are all registered without REDISMODULE_CONFIG_IMMUTABLE, so CONFIG SET can change them while queries run, yet the comments claimed the fields were fixed at load time. The new crate holds the read in one place. It hands back RSConfig by value rather than a reference, because a &'static RSConfig would assert that nothing writes the static while it lives, which CONFIG SET violates from client threads. The copy is a plain unsynchronised load, matching what the C readers of the same fields do; it can tear against a concurrent write, and removing that race needs the C side to store the fields atomically. Returning the whole struct also lets a caller that needs several settings take one snapshot instead of one read per field, so an operation cannot observe a setting changing halfway through. query_eval_ffi::eval_config does exactly that. Co-Authored-By: Claude Opus 5 <[email protected]> * Say what the RSGlobalConfig read does and does not guarantee Review of the wrapper turned up three claims that overstate what a by-value snapshot buys. `get`'s SAFETY comment established liveness and the absence of a reference but not the third precondition for reading a `static mut`, that no other thread writes it — which is exactly the one that does not hold, as the doc comment directly above it already said. The comment now names the race instead of leaving the two in contradiction. For the same reason a snapshot cannot make an operation immune to a concurrent `CONFIG SET`: the struct copy is not atomic, so it narrows the window rather than closing it. `eval_config` additionally called itself the single point where the evaluator reads the global config, which `resolve_scorer` disproves two functions further down. Also mark `get` `#[inline]`, so that a caller wanting one field does not pay for an out-of-line call returning the whole struct in builds without LTO. Co-Authored-By: Claude Opus 5 <[email protected]> * Read config fields individually rather than copying the struct `global_config::get()` returned the whole `RSConfig`. The copy is not atomic, so it did not make the fields it returned agree with one another, while copying a large struct and handing back owned pointers no caller had asked for — among them `defaultScorer`, which `FT.CONFIG SET DEFAULT_SCORER` frees. Replace it with one accessor per field, generated from a macro so a new field cannot be added without the shared safety argument covering it. `default_scorer` is written out rather than generated: it returns `Option<NonNull<c_char>>`, putting the unset case in the type instead of leaving every caller to null-check, and its doc carries the hazard no pointer type can express — the string can be freed while a caller still holds it. Co-Authored-By: Claude Opus 5 <[email protected]> * update wording --------- Co-authored-by: Claude Opus 5 <[email protected]>
…10924) Add a `hide_user_data_from_log` accessor to `global_config` The `hide-user-data-from-log` Redis server configuration decides whether index, field and key names and query terms are obfuscated before they are logged. Reading it through the crate keeps the Rust side of the logging paths free of a raw read of the `RSGlobalConfig` static. Co-authored-by: Claude Opus 5 <[email protected]>
* bench(numeric): add a Rust-vs-C bencher for the numeric top-k path Drives the real C OptimizerIterator through a shim over the same range tree, doc table and search context the Rust source reads, so both sides share one fixture. A preflight asserts both return the same result count before any timing is recorded. * bench(numeric): add an expensive (union) child group * bench(numeric) fix double allocation on expensive children
R2 (NumericIteratorVariant): implement RQEIteratorBoxed + RQESuspendedIterator
wildcard: give `OptimizedWildcard` a suspended counterpart Add `OptimizedWildcardSuspended`, its layout-invariant proof, and the `RQEIteratorBoxed` impl that pairs them. Extracted from the UnionOpaque revision, which carried this wildcard machinery for no reason of its own.
* [MOD-14883] query_eval: port Query_EvalFuzzyNode to Rust A new nodes/fuzzy.rs walks the terms trie through c_trie's iterate_fuzzy and accumulates the per-term readers on the Expansion the prefix and wildcard nodes already share, then unions them. QN_FUZZY joins both dispatch arms — the Rust one and, in query.c, the ported arm of Query_EvalNode — so Query_EvalFuzzyNode goes with it. iterateExpandedTerms and addTerm had no other caller (QN_PREFIX stopped using them when it was ported), so both go too, and with them the second copy of the expansion logic that could drift from the Rust one. Two things the shared expansion could not express before: A pattern the trie declines to walk yields no iterator at all, where a walk that matched nothing yields an empty union — so the walk's outcome is propagated out to eval rather than folded into the accumulated children. The empty-term expansion, which a token no longer than the distance reaches from apiVersion 2, is appended after the walk and is not one of the terms the cap bounds. push_child_ignoring_cap admits it with the cap full and without recording the truncation warning, which push_child now delegates to. Its document count is looked up as the zero-length key rather than as C's one-rune NUL. Both are zero whatever the index holds — the trie refuses a zero-length key on insertion, and TrieNode_Get cannot match one — so this is the same value said more directly. It is computed only on the disk path, which is the only consumer, for the term's IDF. The empty-term gate is widened to i64, so a negative distance closes it rather than wrapping C's size_t comparison open. No query can produce one: every QueryFuzzyNode is built with 1, 2 or 3. PrefixNode_GetTypeString stays: the AST dump still uses it. So do the QN_FUZZY arms of the node-lifetime, dump, param and profile switches, which this change does not touch. queryNeedsOffsets, whose only C caller was addTerm's disk branch, is left exported for now; dropping an unused FFI symbol belongs to a pass over that surface rather than to this port. * enforce fuzzy query maxDist The parser garantees that maxDist is not higher than 3. See query_parser/v2/parser.y:641-651 Higher value would result in out of bound reads so best to enforce it. * query_eval: state the terms-trie invariant once, and check it Four evaluators — token, prefix, wildcard_query and fuzzy — each borrowed the spec's terms trie behind its own debug_assert and its own SAFETY comment citing QueryEvalContext invariants 1/2. Those invariants cover validity and non-mutation but say nothing about the field being non-null, so each site was carrying an unwritten assumption and re-justifying it in slightly different words. The invariant now lives where the rest of the context's pointer contract does, on QueryEvalContext::new: every path that creates an IndexSpec installs a terms trie, unconditionally and whether or not the schema has a text field, and the one path that leaves the field null for a while fills it in — or releases the half-built spec — before the spec can answer a query. A terms_trie accessor on QueryEvalContext asserts it in one place and hands back the wrapper, so a spec that broke the invariant names what went wrong in a debug or test build instead of being a null dereference in whichever evaluator ran first. The accessor is unsafe, because the reference it returns is tied to no lifetime the type system can check. That erasure is deliberate: the trie is owned by the spec rather than by the context, and binding the reference to &self would say otherwise and stop an evaluator holding the trie while borrowing the context exclusively — which the expanding nodes do across a walk that records expansions back into the context. Discharging it is the caller's job, so the accessor states the contract (the reference must not outlive the query) and each evaluator states why its own reference stays inside it. * c_trie: answer num_docs for the empty term without a lookup The fuzzy expansion looked the empty term's document count up in the terms trie on the disk path, to score its IDF. The count is zero whatever the index holds — a zero-length key is refused on insertion, so the trie cannot hold one — and the lookup was already commented as such, so it asked a question whose answer was written next to it. Asking it was not free: the lookup hands the key to a decoder that forms src + slen before testing that its loop is empty, and an empty slice's pointer need not point into an allocation for C to do that arithmetic on. The fuzzy walk one call away already keeps an empty pattern away from the same decoder, with a static sentinel byte, and the wildcard node already passes zero for its own empty term rather than looking it up. So the fuzzy path passes zero directly, and num_docs answers the empty term without reaching for C at all, which keeps any future caller off the same path. Both are covered by new tests: num_docs had none of its own before.
MOD-18288: Skip Flex startup tests on RoR
…11532) sbin/upload-artifacts now uploads via `aws s3api put-object --if-none-match "*"` instead of `aws s3 cp`, and the release workflow's copy_object passes IfNoneMatch="*". Both fail loudly if an object already exists at the target key instead of silently overwriting it. upload-artifacts also propagates a rejected upload to the job exit status, which the `{ ...; } || ...` construct swallowed.
Reserve file descriptors for the search-disk-max-open-files cap search-disk-max-open-files now doubles as the unit the process-wide file-descriptor reservation is granted in: every live disk index costs exactly the cap in reserved descriptors. Raising the cap (at CONFIG SET time or via the disk backend's cap-reapply path) can therefore be refused if the process can't reserve enough headroom, in which case the change is rejected and no database is touched. Lowering always succeeds. Creating a new disk index can likewise be refused if there isn't enough headroom for its share of the cap; surface that as an ordinary index-creation error instead of an assertion, since it's an expected operating condition rather than a bug. Also tightens DISK_MAX_OPEN_FILES_MIN to 20 and lowers the default cap to 200, matching SpeedB's actual table-cache floor (SanitizeOptions clips below 20 anyway) instead of the previous headroom-for-non-data- files estimate. Updates the pre-existing default-value assertion in test_config.py to match. The reservation is granted through RedisModule_SetOpenFilesReservation, which redisearch_disk needs from a newer redismodule-rs commit than RediSearch currently pins; bump the shared redis-module rev so the combined dependency graph resolves to a single version (two revs in the same build previously produced extern "C" signature mismatches). RediSearch's own RedisModule_Init also needs to fetch the new API pointer from the server's GET_API table itself, since the vendored crate declaring it doesn't make the server populate it. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
* [MOD-18899] Save the 8.10 vecsim RDB fixture in RDB format 13 The fixture was saved by Redis 8.10.1, which writes RDB format 15. Redis refuses to load an RDB whose format is newer than its own, so servers that read at most format 13 or 14 abort while loading it. That includes the Redis Enterprise 8.6 runtime that Redis Search Enterprise tests against. Regenerate it with the same Search 8.10.0 module and data on Redis 8.6.6, which writes format 13. The RediSearch payload is unchanged, so the test still covers loading and resaving an index written by Search 8.10. The fixture gets a new name because getRDBFile() reuses any cached copy with the same name, so hosts that already extracted the format-15 file would otherwise keep loading it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Refresh bundled RDB fixtures atomically without versioned names * Isolate bundled RDB fixture caches by checkout --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
* query_eval: test lowering a tag token ending in a dangling UTF-8 lead byte #11202 fixed the unicode_tolower() bug so we can now test this. * redisearch: expose the BAD_POINTER sentinel address to Rust Define BAD_POINTER in terms of an integer BAD_POINTER_ADDR macro and bind it, so Rust callers can recognize the sentinel some C helpers return. * c_trie: read the clock deadline from a request timeout Add QueryRequestTimeoutHandle::clock_deadline, which reports the deadline of a clock-driven timeout cycle and None for any other source.
…rites no explanation (#11603) * Add test for EXPLAINSCORE with a scorer that writes no explanation The example extension's example_scorer returns a score without filling in the explanation. Querying it with WITHSCORES EXPLAINSCORE must still return the score, with an empty explanation. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Fix EXPLAINSCORE crash with scorers that write no explanation EXPLAINSCORE hands every scorer a zeroed explanation node. Extension scorers are not required to fill it in, and the example extension's example_scorer does not, so the node's text stays NULL. recExplainReply passed that NULL text to the reply as a simple string, which crashed Redis on FT.SEARCH ... WITHSCORES EXPLAINSCORE SCORER <such scorer>. Reply with an empty string for a missing explanation text, both for a leaf and for a node with children. The reply keeps its shape, so the coordinator, which requires a string for every explanation node, parses shard replies unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…iled replication sync (#11619) [MOD-15685] Refuse a legacy index spec RESTORE after a failed load The guard added in #10872 refused a legacy ft_index0 load when the legacy-spec registry or the UPGRADE_INDEX rules were NULL, taking that as "no load in progress". A failed load breaks that assumption: LOADING_FAILED clears the loading flag but frees neither global, and the rules are only ever freed by a successful load. On a server that has not completed a load since startup - for example a replica whose first full sync failed and was then promoted - a RESTORE of a truncated legacy payload got past the guard and crashed on the NULL spec name. Key the refusal on g_isLoading as well. The new test drives exactly that sequence against a fake master; it crashes the server without the fix. Co-authored-by: Claude Opus 5.5 <[email protected]>
Homebrew's unversioned `openssl` formula now installs OpenSSL 4 and unlinks openssl@3. Redis's Makefile builds against the unversioned `opt/openssl` prefix, and its tls.c calls APIs OpenSSL 4 deprecates, so every macOS job that compiles Redis with TLS fails under -Werror. Install openssl@3 explicitly and point the Redis TLS build at it. Co-authored-by: Claude Opus 5.5 <[email protected]>
…master 8.8-rse is re-branched from master's tip instead of merging master forward. src/version.h must stay branch-specific: it mirrors [email protected] (8.8.6) rather than master's 99.99.99 development placeholder. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Master requires Redis 8.9.241 to match its own pinned development Redis. 8.8-rse ships in the 8.8 Enterprise line, which reports a lower version, so the master gate refuses to load the module there. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…unstable 8.8-rse ships against released Redis engines, so CI resolves the newest 8.10.x release tag (task-get-redis-tag.yml prefix) rather than master's pinned unstable commit, and nightly no longer runs against unstable. Static redis-ref defaults move to 8.10.2 to match. Redis 8.10.2 carries redis/redis#15722, so the coordinator flow tests pass --cluster_bus_port_protected_mode no on 8.10.2+ as well as unstable. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ranch Records origin/8.8-rse as an ancestor while keeping this branch's tree unchanged (merge -s ours), so the re-branch lands on 8.8-rse through the normal merge queue without a force-push. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f894abcb5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .majorVersion = 8, | ||
| .minorVersion = 4, | ||
| .minorVersion = 8, | ||
| .patchVersion = 0, |
There was a problem hiding this comment.
Keep the OSS runtime floor at the required API version
This floor applies to OSS as well as Enterprise. An OSS Redis 8.8/8.9 cluster can now load the module manually even though it lacks RedisModule_GetClusterNodeSlotRanges (the package manifest identifies 8.10 as the first engine version with that API). RedisModule_Init leaves unavailable APIs as null, then startup initializes the OSS topology updater, which reaches the unguarded call in MRClusterTopology_FromAPI and crashes the server. Preserve the 8.10 floor for OSS and make the lower allowance specific to the Enterprise runtime that needs it.
Useful? React with 👍 / 👎.
| if (ShouldDeferKeyspaceNotification(redisCommand)) { | ||
| int rc = RedisModule_AddPostNotificationJobForKey(ctx, HandlePerKeyJobFunc, key, | ||
| (void *)(uintptr_t)redisCommand, NULL); | ||
| RS_LOG_ASSERT(rc == REDISMODULE_OK, "Failed to add post-notification job for key"); |
There was a problem hiding this comment.
Do not defer field-expiry updates on unpatched Redis 8.10
For a HASH index with an actively expired field, the released 8.10 runtimes selected by this change do not drain post-notification jobs after the hexpired notification. Deferring this event here therefore leaves Indexes_UpdateMatchingWithSchemaRules uncalled, so FT.SEARCH can continue returning terms and values from the expired field (as exercised by tests/pytests/test_expire.py). Keep using the patched Redis revision or provide a non-deferred fallback for these runtimes before shipping the branch.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.8-rse #11635 +/- ##
==========================================
Coverage ? 83.53%
==========================================
Files ? 665
Lines ? 86529
Branches ? 40356
==========================================
Hits ? 72284
Misses ? 13871
Partials ? 374
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… connections (#11027)" This reverts commit ecfa636. #11027 takes each node's transport from the REDISMODULE_NODE_PORT_TLS flag returned by RedisModule_GetClusterNodeInfo. Only Redis unstable sets that flag; released Redis 8.10.x (the engine line 8.8-rse is tested and shipped against) never does. The coordinator then dials every shard's TLS port in plaintext, the shard rejects the connection ("SSL routines::wrong version number"), and distributed commands fail on TLS clusters. This applies both to OSS cluster and to Enterprise's short-form topology, which uses the same path. Restore deriving the transport from tls-cluster / tls-port, as on 8.10. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 738e2b7363
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| description: "Prefix to filter tags, for getting latest release of a specific version" | ||
| type: string | ||
| # 8.8-rse ships against released Redis 8.10 engines, never unstable. | ||
| default: '8.10.' |
There was a problem hiding this comment.
Exclude prereleases when resolving the Redis test tag
When Redis publishes an 8.10.x prerelease (for example, 8.10.3-rc1) while 8.10.2 is the latest stable release, this default takes the prefix path in task-get-latest-tag.yml, which selects the greatest tag_name with sort -V without filtering the release's prerelease flag. That makes PR, merge-queue, and nightly jobs test an unreleased engine rather than the intended latest released 8.10 engine; filter prereleases/drafts before sorting, or resolve only stable releases.
Useful? React with 👍 / 👎.
|


Describe the changes in the pull request
8.8-rseis ~473 commits behindmasterand carries 76 branch-only commits, mostly backports of fixes thatmasteralready has. Re-syncing it by merging forward means resolving the same fixes twice.8.8-rseis re-branched frommaster(cf6be8195), plus four branch-specific commits. The review diff againstmasteris the part to read: master...alon-realign-8.8-rsesrc/version.hstays at8.8.6, mirroring [email protected], instead of99.99.99.supportedVersiondrops from8.9.241to8.8.0. Master's floor tracks its own pinned development Redis, and 8.8 Enterprise engines report lower versions, so under that floor the module refuses to load.8.10.xrelease instead of master's pinnedunstablecommit. Nightly no longer runs againstunstable. Coordinator tests pass--cluster_bus_port_protected_mode noon 8.10.2+ because Make an unauthenticated cluster bus port an explicit choice redis/redis#15722 shipped in 8.10.2.REDISMODULE_NODE_PORT_TLSflag, which only Redis unstable sets. On 8.10.x the coordinator dials TLS shards in plaintext, so distributed commands fail on TLS clusters. That affects both OSS cluster and Enterprise's short-form topology. The revert restores deriving TLS fromtls-cluster, as on8.10.8.8-rsehas the same code asmasterapart from the four items above. Compared with the old8.8-rse, users of the 8.8 line see master's behavior, including:ON_TIMEOUT return-strictis accepted again ([8.8-rse] [MOD-13757] Remove return-strict from timeout config surface #10586 is not re-applied).masterdoes not have them.How to land: use the normal merge queue. The tip is a
git merge -s ours origin/8.8-rse, so the old history becomes an ancestor while the file tree stays exactlymasterplus the branch-specific commits above. Merging or squashing therefore yields that tree on8.8-rse, and no force-push is needed. If8.8-rsemoves before this lands, repeat the-s oursmerge rather than a regular one.Reviewers should know:
INDEX_CURRENT_VERSIONgoes from 27 to 28 (frommaster). RDBs written by this line cannot be loaded by earlier 8.8.x.pack/ramp-*.ymlkeep master'smin_redis_version: "8.10", unchanged from the old8.8-rse.Which additional issues this PR fixes
Main objects this PR modified
src/version.h: RSE release version8.8.6.supportedVersioninsrc/module.c: the Redis load gate is lowered to8.8.0.task-get-redis-tag.ymland the reusable test/build workflows: Redis selection follows released 8.10.x, with the cluster-bus opt-out for 8.10.2+.src/coord/rmr/cluster_topology.c: each shard's TLS transport comes fromtls-clusteragain ([MOD-15869] Use Redis node metadata for cluster TLS connections #11027 reverted).Mark if applicable
Both boxes describe the difference from the old
8.8-rse:return-strictand NUMERIC-on-Flex are back, and the RDB encoding version goes from 27 to 28. Compared withmaster, neither applies.Release Notes
The 8.8 line picks up
master's changes. Their release notes come from the originalmasterPRs.🤖 Generated with Claude Code