-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete commit log files that are covered by snapshot files #802
Merged
Merged
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8a33ff2
Squash
1e2573d
Fix broken tests
d14b3f5
Reduce max points to 100
c81d092
Delete TODO
b3efd63
Remove unnecessary nil check
9d2f4fb
Fix panic in integration test
74920dd
Fix broken integration test
ab9a2ab
Fix typo
13be077
Fix typo
cf60364
Fix typo
a4b4f8e
undelete cod
632adef
Address Robs feedback
97747fe
Fix prop test
4f96547
fix compilation issue
dd6c1ed
cleanup function calls
f09ef58
Refactor how we filter commit log files and handle errors
5ce1e6d
Fix compulation error
134375b
Fix compulation issue
a68bb16
Fix bug in cleanup logic
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,9 @@ import ( | |
"testing" | ||
"time" | ||
|
||
"github.com/m3db/m3db/src/dbnode/integration/generate" | ||
"github.com/m3db/m3db/src/dbnode/storage/namespace" | ||
xtime "github.com/m3db/m3x/time" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
|
@@ -61,11 +64,27 @@ func TestDiskCleanup(t *testing.T) { | |
numTimes := 10 | ||
fileTimes := make([]time.Time, numTimes) | ||
now := testSetup.getNowFn() | ||
ns1, err := namespace.NewMetadata(testNamespaces[0], namespace.NewOptions()) | ||
require.NoError(t, err) | ||
for i := 0; i < numTimes; i++ { | ||
fileTimes[i] = now.Add(time.Duration(i) * blockSize) | ||
} | ||
writeDataFileSetFiles(t, testSetup.storageOpts, md, shard, fileTimes) | ||
writeCommitLogs(t, filePathPrefix, fileTimes) | ||
for _, clTime := range fileTimes { | ||
// Need to generate valid commit log files otherwise cleanup will fail. | ||
data := map[xtime.UnixNano]generate.SeriesBlock{ | ||
xtime.ToUnixNano(clTime): nil, | ||
} | ||
writeCommitLogDataSpecifiedTS( | ||
t, | ||
testSetup, | ||
testSetup.storageOpts.CommitLogOptions().SetFlushInterval(defaultIntegrationTestFlushInterval), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super nit: Same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure |
||
data, | ||
ns1, | ||
clTime, | ||
false, | ||
) | ||
} | ||
|
||
// Move now forward by retentionPeriod + 2 * blockSize so fileset files | ||
// and commit logs at now will be deleted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: Maybe declare these options before the
for
loop? Just to avoid this super long line and all:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure