-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[BUG]: Handle version file creation with empty file paths #4552
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
base: main
Are you sure you want to change the base?
[BUG]: Handle version file creation with empty file paths #4552
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Fix Version File Creation with Empty File Paths This PR fixes a bug where compaction could flush to sysdb with empty file paths (which happens when there are no changes to segments after applying logs). While sysdb handled this correctly by keeping the previous segment file paths, versioning was creating versions with empty file paths in the version file. This could lead to data loss in S3 after garbage collection. Key Changes: Affected Areas: This summary was automatically generated by @propel-code-bot |
@@ -1544,7 +1559,8 @@ func (tc *Catalog) FlushCollectionCompactionForVersionedCollection(ctx context.C | |||
for numAttempts < maxAttempts { | |||
numAttempts++ | |||
// Get the current version info and the version file from the table. | |||
collectionEntry, err := tc.metaDomain.CollectionDb(ctx).GetCollectionEntry(types.FromUniqueID(flushCollectionCompaction.ID), nil) | |||
collectionEntry, segments, err := tc.GetCollectionWithSegments(ctx, flushCollectionCompaction.ID) | |||
// collectionEntry, err := tc.metaDomain.CollectionDb(ctx).GetCollectionEntry(types.FromUniqueID(flushCollectionCompaction.ID), nil) |
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.
?
@@ -1574,15 +1590,16 @@ func (tc *Catalog) FlushCollectionCompactionForVersionedCollection(ctx context.C | |||
} | |||
|
|||
existingVersionFileName := collectionEntry.VersionFileName | |||
// existingSegments := segments |
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.
?
@@ -21,6 +23,10 @@ type Collection struct { | |||
TotalRecordsPostCompaction uint64 | |||
SizeBytesPostCompaction uint64 // Note: This represents the size of the records off the log | |||
LastCompactionTimeSecs uint64 | |||
IsDeleted bool | |||
VersionFileName string | |||
CreatedAt time.Time |
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.
is created at different than the Ts field?
Description of changes
Improvements & Bug fixes
New functionality
Test plan
Documentation Changes
None