Skip to content

lock before opening indexes if info - [MOD-10007] [MOD-9761]#6279

Merged
BenGoldberger merged 31 commits intomasterfrom
beng-lock-speck-in-info
Jun 17, 2025
Merged

lock before opening indexes if info - [MOD-10007] [MOD-9761]#6279
BenGoldberger merged 31 commits intomasterfrom
beng-lock-speck-in-info

Conversation

@BenGoldberger
Copy link
Collaborator

@BenGoldberger BenGoldberger commented Jun 8, 2025

Move the locking of the spec in IndexInfoCommand->fillReplyWithIndexInfo
Hopefully this will fix the bug and some flaky tests

Plus handle the while loop in FGC_recvFixed, that seems to block the gc thread

@codecov
Copy link

codecov bot commented Jun 8, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.

Project coverage is 88.77%. Comparing base (4940349) to head (6733c68).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/fork_gc.c 70.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6279      +/-   ##
==========================================
- Coverage   88.78%   88.77%   -0.01%     
==========================================
  Files         243      243              
  Lines       40893    40900       +7     
  Branches     3483     3483              
==========================================
+ Hits        36307    36311       +4     
- Misses       4543     4546       +3     
  Partials       43       43              
Flag Coverage Δ
flow 82.20% <57.14%> (-0.12%) ⬇️
unit 46.31% <66.66%> (+<0.01%) ⬆️

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.

@BenGoldberger BenGoldberger requested a review from kei-nan June 9, 2025 07:57
@github-actions github-actions bot added the size:M label Jun 9, 2025
@BenGoldberger BenGoldberger requested a review from alonre24 June 10, 2025 08:47
kei-nan
kei-nan previously approved these changes Jun 10, 2025
@BenGoldberger BenGoldberger requested a review from alonre24 June 11, 2025 06:44
Copy link
Collaborator

@alonre24 alonre24 left a comment

Choose a reason for hiding this comment

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

💪

@BenGoldberger BenGoldberger requested a review from kei-nan June 17, 2025 09:35
// Buff shouldn't be NULL.
static void FGC_sendFixed(ForkGC *fgc, const void *buff, size_t len) {
RS_LOG_ASSERT(len > 0, "buffer length cannot be 0");
ssize_t size = write(fgc->pipefd[GC_WRITERFD], buff, len);
Copy link
Collaborator

@kei-nan kei-nan Jun 17, 2025

Choose a reason for hiding this comment

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

@BenGoldberger how are these GC changes related to the info changes and the locking placement?

Copy link
Collaborator

@kei-nan kei-nan Jun 17, 2025

Choose a reason for hiding this comment

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

If they are not, then maybe move them to a different PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It a small fix to an issue that came up while testing this, so I think it fine to include it here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The GC changes are not related directly, but they are needed to deflake tests. We could move it to a different PR, but since it is a small fix and PR is ready, I suggest we leave it as is. @BenGoldberger, please update the PR description and the MOD tickets that are related

@BenGoldberger BenGoldberger added this pull request to the merge queue Jun 17, 2025
Merged via the queue into master with commit 52cbc9c Jun 17, 2025
55 of 56 checks passed
@BenGoldberger BenGoldberger deleted the beng-lock-speck-in-info branch June 17, 2025 12:40
@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-6279-to-2.8 origin/2.8
cd .worktree/backport-6279-to-2.8
git switch --create backport-6279-to-2.8
git cherry-pick -x 52cbc9c53a83f1cefcf2807ab4fc06fac5c1ca77

@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-6279-to-2.10 origin/2.10
cd .worktree/backport-6279-to-2.10
git switch --create backport-6279-to-2.10
git cherry-pick -x 52cbc9c53a83f1cefcf2807ab4fc06fac5c1ca77

@redisearch-backport-pull-request
Copy link
Contributor

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

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

git fetch origin 8.0
git worktree add -d .worktree/backport-6279-to-8.0 origin/8.0
cd .worktree/backport-6279-to-8.0
git switch --create backport-6279-to-8.0
git cherry-pick -x 52cbc9c53a83f1cefcf2807ab4fc06fac5c1ca77

@BenGoldberger BenGoldberger changed the title lock before opening indexes if info - [MOD-10007] lock before opening indexes if info - [MOD-10007] [MOD-9761] Jun 17, 2025
BenGoldberger added a commit that referenced this pull request Jun 18, 2025
* move the lock to include the opening of the indexes

* add pytest

* try to fix test

* fix test

* move lock sooner

* spell checker

* try to fix test

* pr changes

* pr changes

* remove debugPrint in test

* remove debug prints

* add gc invokes while deleting docs

* add timeout before read

* add the timeout to gc struct

* change timeout to 3 min

* try to change the while

* switch to poll

* refactor gc struct

* add gc_wait in test

* pr changes

* pr changes

* pr changes

* pr change

* try to fix leak in test

* revert priority change

* remove deps changes

* pr changes

* revert len check

(cherry picked from commit 52cbc9c)
BenGoldberger added a commit that referenced this pull request Jun 18, 2025
* move the lock to include the opening of the indexes

* add pytest

* try to fix test

* fix test

* move lock sooner

* spell checker

* try to fix test

* pr changes

* pr changes

* remove debugPrint in test

* remove debug prints

* add gc invokes while deleting docs

* add timeout before read

* add the timeout to gc struct

* change timeout to 3 min

* try to change the while

* switch to poll

* refactor gc struct

* add gc_wait in test

* pr changes

* pr changes

* pr changes

* pr change

* try to fix leak in test

* revert priority change

* remove deps changes

* pr changes

* revert len check

(cherry picked from commit 52cbc9c)
BenGoldberger added a commit that referenced this pull request Jun 18, 2025
* move the lock to include the opening of the indexes

* add pytest

* try to fix test

* fix test

* move lock sooner

* spell checker

* try to fix test

* pr changes

* pr changes

* remove debugPrint in test

* remove debug prints

* add gc invokes while deleting docs

* add timeout before read

* add the timeout to gc struct

* change timeout to 3 min

* try to change the while

* switch to poll

* refactor gc struct

* add gc_wait in test

* pr changes

* pr changes

* pr changes

* pr change

* try to fix leak in test

* revert priority change

* remove deps changes

* pr changes

* revert len check

(cherry picked from commit 52cbc9c)
github-merge-queue bot pushed a commit that referenced this pull request Jun 19, 2025
…6279) (#6338)

lock before opening indexes if info - [MOD-10007] (#6279)

* move the lock to include the opening of the indexes

* add pytest

* try to fix test

* fix test

* move lock sooner

* spell checker

* try to fix test

* pr changes

* pr changes

* remove debugPrint in test

* remove debug prints

* add gc invokes while deleting docs

* add timeout before read

* add the timeout to gc struct

* change timeout to 3 min

* try to change the while

* switch to poll

* refactor gc struct

* add gc_wait in test

* pr changes

* pr changes

* pr changes

* pr change

* try to fix leak in test

* revert priority change

* remove deps changes

* pr changes

* revert len check

(cherry picked from commit 52cbc9c)
github-merge-queue bot pushed a commit that referenced this pull request Jun 19, 2025
…6279) (#6340)

lock before opening indexes if info - [MOD-10007] (#6279)

* move the lock to include the opening of the indexes

* add pytest

* try to fix test

* fix test

* move lock sooner

* spell checker

* try to fix test

* pr changes

* pr changes

* remove debugPrint in test

* remove debug prints

* add gc invokes while deleting docs

* add timeout before read

* add the timeout to gc struct

* change timeout to 3 min

* try to change the while

* switch to poll

* refactor gc struct

* add gc_wait in test

* pr changes

* pr changes

* pr changes

* pr change

* try to fix leak in test

* revert priority change

* remove deps changes

* pr changes

* revert len check

(cherry picked from commit 52cbc9c)
github-merge-queue bot pushed a commit that referenced this pull request Jun 19, 2025
…6279) (#6339)

lock before opening indexes if info - [MOD-10007] (#6279)

* move the lock to include the opening of the indexes

* add pytest

* try to fix test

* fix test

* move lock sooner

* spell checker

* try to fix test

* pr changes

* pr changes

* remove debugPrint in test

* remove debug prints

* add gc invokes while deleting docs

* add timeout before read

* add the timeout to gc struct

* change timeout to 3 min

* try to change the while

* switch to poll

* refactor gc struct

* add gc_wait in test

* pr changes

* pr changes

* pr changes

* pr change

* try to fix leak in test

* revert priority change

* remove deps changes

* pr changes

* revert len check

(cherry picked from commit 52cbc9c)
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.

3 participants