Skip to content

Modernize SnapshotDeletionPolicy and PersistentSnapshotDeletionPolicy - #16482

Open
gsmiller wants to merge 5 commits into
apache:mainfrom
gsmiller:GH/delete-policy-tidy-pr
Open

Modernize SnapshotDeletionPolicy and PersistentSnapshotDeletionPolicy#16482
gsmiller wants to merge 5 commits into
apache:mainfrom
gsmiller:GH/delete-policy-tidy-pr

Conversation

@gsmiller

@gsmiller gsmiller commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

I bundled some modernization/cleanup changes here as I saw opportunities while going through this code for another project I'm working on. I think it's worth a modernization pass on this code (much of it is 13 years old). Also (semi-selfishly), since I've been away from Lucene for a few months, I'm using this as an opportunity to get my hands dirty again.

This change includes:

  1. Small modernizations to be more idiomatic with newer versions of Java
  2. Marking more methods synchronized (e.g., PersistentSnapshotDeletionPolicy#getLastSaveFile could technically have a race condition).
  3. Adding consistent error recovery logic to PersistentSnapshotDeletionPolicy#release(long)
  4. Tightening up the logic in PersistentSnapshotDeletionPolicy#loadPriorSnapshots to only read from the latest ref-count file (and to ensure all older files are cleaned up, not relying on the order the filenames are read from the directory).

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.

1 participant