Skip to content

Avoid lazy expiration in background indexing for CRDT [MOD-9486]#6002

Merged
lerman25 merged 4 commits intomasterfrom
omerL-avoid-lazy-expire-CRDT-crdtOnly
Apr 29, 2025
Merged

Avoid lazy expiration in background indexing for CRDT [MOD-9486]#6002
lerman25 merged 4 commits intomasterfrom
omerL-avoid-lazy-expire-CRDT-crdtOnly

Conversation

@lerman25
Copy link
Collaborator

@lerman25 lerman25 commented Apr 23, 2025

Currently, during the background scan, using RM_KeyType to check the key type causes the key to expire in CRDT, due to CRDT's RM_KeyType function.
To solve, if we are on crdt, we open the key in the scan with the noeffect flag.
This continues the work from #5274.

@lerman25 lerman25 changed the title Omer l avoid lazy expire crdt crdt only Avoid lazy expiration in background indexing for CRDT [MOD-9486] Apr 23, 2025
@lerman25 lerman25 marked this pull request as ready for review April 23, 2025 15:38
@codecov
Copy link

codecov bot commented Apr 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.21%. Comparing base (04a93a4) to head (303a8ca).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6002      +/-   ##
==========================================
- Coverage   88.24%   88.21%   -0.04%     
==========================================
  Files         220      220              
  Lines       39516    39516              
  Branches     2780     2780              
==========================================
- Hits        34871    34858      -13     
- Misses       4636     4649      +13     
  Partials        9        9              
Flag Coverage Δ
flow 82.67% <100.00%> (-0.04%) ⬇️
unit 44.65% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DvirDukhan DvirDukhan requested a review from Copilot April 27, 2025 19:21
@DvirDukhan
Copy link

Did we validate it with the CRDT team?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue in background indexing for CRDT by ensuring that keys opened for CRDT are always opened with the proper flags to avoid lazy expiration.

  • Update condition to force reopening keys for CRDT using the 'noeffect' flag.
  • Adjust comment text and order to improve clarity around document type checking and key closing.

@alonre24 alonre24 requested a review from Copilot April 29, 2025 09:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the lazy expiration issue during background indexing for CRDT by ensuring that keys for CRDT are always opened with the noeffect flag, avoiding side effects during type checks. The key changes include:

  • Updating the conditional to re-open the key if operating on CRDT.
  • Rearranging the document type check to occur after closing the key when necessary.
  • Modifying comments to better describe the steps in key handling for indexing.
Comments suppressed due to low confidence (1)

src/spec.c:2236

  • The updated conditional re-opens the key when 'isCrdt' is true, even if 'key' is already non-null. Please verify that this behavior is intended and add a comment clarifying that re-opening is necessary to apply the 'noeffect' flag for CRDT keys.
if (!key || isCrdt) {

@alonre24 alonre24 requested a review from MeirShpilraien April 29, 2025 09:42
@lerman25 lerman25 added this pull request to the merge queue Apr 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 29, 2025
@lerman25 lerman25 added this pull request to the merge queue Apr 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 29, 2025
@lerman25 lerman25 added this pull request to the merge queue Apr 29, 2025
Merged via the queue into master with commit 17193a5 Apr 29, 2025
20 checks passed
@lerman25 lerman25 deleted the omerL-avoid-lazy-expire-CRDT-crdtOnly branch April 29, 2025 16:42
@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 2.8, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.8
git worktree add -d .worktree/backport-6002-to-2.8 origin/2.8
cd .worktree/backport-6002-to-2.8
git switch --create backport-6002-to-2.8
git cherry-pick -x 17193a5eed07f2bc43cb3fdfa4166f9466277209

@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 2.6, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.6
git worktree add -d .worktree/backport-6002-to-2.6 origin/2.6
cd .worktree/backport-6002-to-2.6
git switch --create backport-6002-to-2.6
git cherry-pick -x 17193a5eed07f2bc43cb3fdfa4166f9466277209

@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 2.10, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.10
git worktree add -d .worktree/backport-6002-to-2.10 origin/2.10
cd .worktree/backport-6002-to-2.10
git switch --create backport-6002-to-2.10
git cherry-pick -x 17193a5eed07f2bc43cb3fdfa4166f9466277209

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Apr 29, 2025
* fix leak +  open alawys on crdt

* complete comment

* format

(cherry picked from commit 17193a5)
@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 8.0:

lerman25 added a commit that referenced this pull request Apr 29, 2025
* fix leak +  open alawys on crdt

* complete comment

* format

(cherry picked from commit 17193a5)
lerman25 added a commit that referenced this pull request Apr 29, 2025
* fix leak +  open alawys on crdt

* complete comment

* format

(cherry picked from commit 17193a5)
lerman25 added a commit that referenced this pull request Apr 29, 2025
* fix leak +  open alawys on crdt

* complete comment

* format

(cherry picked from commit 17193a5)
github-merge-queue bot pushed a commit that referenced this pull request Apr 29, 2025
#6057)

Avoid lazy expiration in background indexing for CRDT [MOD-9486] (#6002)

* fix leak +  open alawys on crdt

* complete comment

* format

(cherry picked from commit 17193a5)
github-merge-queue bot pushed a commit that referenced this pull request Apr 29, 2025
#6055)

Avoid lazy expiration in background indexing for CRDT [MOD-9486] (#6002)

* fix leak +  open alawys on crdt

* complete comment

* format

(cherry picked from commit 17193a5)

Co-authored-by: lerman25 <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request May 6, 2025
…6] (#6056)

Avoid lazy expiration in background indexing for CRDT [MOD-9486] (#6002)

* fix leak +  open alawys on crdt

* complete comment

* format

(cherry picked from commit 17193a5)
nafraf pushed a commit that referenced this pull request May 13, 2025
* fix leak +  open alawys on crdt

* complete comment

* format
JoanFM pushed a commit that referenced this pull request May 27, 2025
* fix leak +  open alawys on crdt

* complete comment

* format
JoanFM pushed a commit that referenced this pull request May 27, 2025
* fix leak +  open alawys on crdt

* complete comment

* format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants