Skip to content

SAMZA-2447: Checkpoint dir removal should only search in valid store dirs - #1261

Merged
prateekm merged 4 commits into
apache:masterfrom
bkonold:checkpoint_npe
Jan 28, 2020
Merged

SAMZA-2447: Checkpoint dir removal should only search in valid store dirs#1261
prateekm merged 4 commits into
apache:masterfrom
bkonold:checkpoint_npe

Conversation

@bkonold

@bkonold bkonold commented Jan 28, 2020

Copy link
Copy Markdown
Contributor

Symptom: NPE when attempting to remove old checkpoint directories.

Cause: Removal of old checkpoints assumes every file in the logged store base directory is also a directory, which may not be true if the user has configured it to a path that is not exclusive to store contents.

Changes: Check that the result of listFiles is non-null before attempting to delete.

Tests: Wrote a test to mimic the behavior of a non-directory file in the logged store base directory. Test fails without the patch, passes with it.

API Changes: None

Upgrade Instructions: None

Usage Instructions: None

}

@Test
public void testRemoveOldCheckpoints() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like this is testing the specific sub-case when listFiles returns null. If so, let's rename method to reflect that (e.g. testRemoveOldCheckpointsWhenXYZ

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@prateekm prateekm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix.

@prateekm
prateekm merged commit 3ce0aa3 into apache:master Jan 28, 2020
@bkonold
bkonold deleted the checkpoint_npe branch June 10, 2020 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants