You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#969.
The current implementation fails tests when running against Redis 8
(presumably the version in which the error message from `FT.INFO`
changed).
Introduced a new implementation for `CreateAndAliasIndex` which does the
following:
1. Query `FT._LIST`.
2. Finds all existing indexes which match the versioned index pattern
(index + "_v" + version).
3. Creates a new index with the latest version + 1 (or 1 if no existing
index).
4. Updates the alias to point to the new index (works whether or not the
alias already exists).
5. Drops all the old indexes.
The implementation is shared between Hash and JSON repositories to avoid
duplication.
The new implementation passes the tests against Redis 8 and redis-stack.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes the RediSearch index rotation logic (create/alias/drop), which
could impact index availability or unexpectedly drop indexes if naming
matches; behavior is exercised by updated tests across two Redis
versions.
>
> **Overview**
> Fixes `CreateAndAliasIndex` for both Hash and JSON repositories by
replacing the `FT.INFO`/error-string-based flow with a shared
implementation that uses `FT._LIST` to discover existing `*_vN` indexes,
create the next version, `FT.ALIASUPDATE` the alias, and drop prior
versions.
>
> Updates tests to run the alias/versioning behavior against both
redis-stack (RediSearch 2.8.4) and Redis 8.6.0, and refactors test
client setup to support multiple server targets.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
da04f17. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
0 commit comments