fix: resolve stale document bug on policy update and add comprehensive e2e coverage#69
Merged
JoseSzycho merged 2 commits intomainfrom Mar 11, 2026
Merged
fix: resolve stale document bug on policy update and add comprehensive e2e coverage#69JoseSzycho merged 2 commits intomainfrom
JoseSzycho merged 2 commits intomainfrom
Conversation
…licy caching, to avoid stale policies This is related to a race condition, in which a resourceindexpolicy can be updated, but the reindexer cache don't get the update on time, so it reindex the resources with a stale version of it.
scotwells
approved these changes
Mar 11, 2026
Comment on lines
+311
to
+325
| # ========================================================================= | ||
| # Cleanup | ||
| # ========================================================================= | ||
| - name: cleanup | ||
| description: "Removes all resources created by this test" | ||
| try: | ||
| - script: | ||
| timeout: 60s | ||
| content: | | ||
| kubectl delete resourceindexpolicy e2e-search-flow-secret-policy e2e-duplicate-fields-secret-policy --ignore-not-found=true || true | ||
| kubectl delete secret e2e-search-target-secret -n default --ignore-not-found=true || true | ||
| kubectl delete secret e2e-search-excluded-secret -n e2e-search-excluded --ignore-not-found=true || true | ||
| kubectl delete namespace e2e-search-excluded --ignore-not-found=true || true | ||
| check: | ||
| ($error): ~ |
Contributor
There was a problem hiding this comment.
Chainsaw should automatically clean up resources it creates.
Contributor
Author
There was a problem hiding this comment.
Oh, is the second time I forget that. Will fix that
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.
Summary
Bug fix: Resources that no longer match a
ResourceIndexPolicyafter a CEL condition update were not being removed from the Meilisearch index. The re-index consumer was evaluating resources against a stale policy cache, causing the old (broader) conditions to still match everything.e2e tests: Added six end-to-end test suites covering the full search pipeline — indexing, pagination, continue tokens, backfill, finalizer cleanup, resource deletion/update, and policy spec updates.
Dev workflow: Set
imagePullPolicy: Neverin the dev and CI kustomize overlays sotask dev:build && task dev:loadalways deploys the freshly built image without the kubelet using a stale cached layer.Related to:
Closes #20