Skip to content

Add global marked deleted to stats [MOD-6053]#5183

Merged
alonre24 merged 7 commits intomasterfrom
marked_deleted_stats
Nov 13, 2024
Merged

Add global marked deleted to stats [MOD-6053]#5183
alonre24 merged 7 commits intomasterfrom
marked_deleted_stats

Conversation

@alonre24
Copy link
Collaborator

@alonre24 alonre24 commented Nov 8, 2024

Describe the changes in the pull request

Add the total logically deleted documents (i.e., documents that were deleted and have not yet been handled by the GC) among all indexes to the global shard info report.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

@codecov
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.59%. Comparing base (5884687) to head (054d43c).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5183      +/-   ##
==========================================
+ Coverage   86.55%   86.59%   +0.03%     
==========================================
  Files         193      193              
  Lines       34756    34768      +12     
==========================================
+ Hits        30083    30106      +23     
+ Misses       4673     4662      -11     

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

Copy link
Collaborator

@GuyAv46 GuyAv46 left a comment

Choose a reason for hiding this comment

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

Nice
A few comments
Note that you can hold the GIL in most if not all of the places you used the new counter API. Consider ensuring that and remove the need for atomic counting and reading

Copy link
Collaborator

@meiravgri meiravgri left a comment

Choose a reason for hiding this comment

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

nice and clean (tartei)


static void onTerminateCb(void *privdata) {
ForkGC *gc = privdata;
IndexsGlobalStats_UpdateLogicallyDeleted(-gc->deletedDocsFromLastRun);
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a scenario where the gc is manually stopped and this callback will not be called?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Shouldn't be. If so, and the spec is dropped, then no one frees the GC and we get a leak

GuyAv46
GuyAv46 previously approved these changes Nov 12, 2024
@alonre24 alonre24 added this pull request to the merge queue Nov 13, 2024
Merged via the queue into master with commit b4d2109 Nov 13, 2024
@alonre24 alonre24 deleted the marked_deleted_stats branch November 13, 2024 10:18
redisearch-backport-pull-request bot pushed a commit that referenced this pull request Nov 13, 2024
* Add global marked deleted to stats

* Fix leak

* CR - moving updates to where index spec is held, using int64 for safety

* Addressing CR - adding unit test, protecting the update

* move for readability

* improve test

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

Successfully created backport PR for 2.10:

@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 8.0:

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Nov 13, 2024
* Add global marked deleted to stats

* Fix leak

* CR - moving updates to where index spec is held, using int64 for safety

* Addressing CR - adding unit test, protecting the update

* move for readability

* improve test

(cherry picked from commit b4d2109)
github-merge-queue bot pushed a commit that referenced this pull request Nov 14, 2024
* Add global marked deleted to stats [MOD-6053] (#5183)

* Add global marked deleted to stats

* Fix leak

* CR - moving updates to where index spec is held, using int64 for safety

* Addressing CR - adding unit test, protecting the update

* move for readability

* improve test

(cherry picked from commit b4d2109)

* remove monitorDocumentExpiration that wasn't cp'd

* deflake test

---------

Co-authored-by: alonre24 <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Nov 14, 2024
* Add global marked deleted to stats [MOD-6053] (#5183)

* Add global marked deleted to stats

* Fix leak

* CR - moving updates to where index spec is held, using int64 for safety

* Addressing CR - adding unit test, protecting the update

* move for readability

* improve test

(cherry picked from commit b4d2109)

* remove monitorDocumentExpiration that wasn't cp'd

* deflake test

---------

Co-authored-by: alonre24 <[email protected]>
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