-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[ENH]: add purging log query and property test #2020
[ENH]: add purging log query and property test #2020
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @nicolasgere and the rest of your teammates on Graphite |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
go/database/log/queries/queries.sql
Outdated
@@ -29,3 +29,6 @@ UPDATE collection set record_enumeration_offset_position = $2 where id = $1; | |||
|
|||
-- name: InsertCollection :one | |||
INSERT INTO collection (id, record_enumeration_offset_position, record_compaction_offset_position) values($1, $2, $3) returning *; | |||
|
|||
-- name: PurgeRecords :exec | |||
DELETE FROM record_log r using collection c where r.collection_id = c.id and r.offset < c.record_compaction_offset_position; |
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.
newline
@@ -138,7 +138,8 @@ func CreateTestCollection(db *gorm.DB, collectionName string, dimension int32, d | |||
return "", err | |||
} | |||
} | |||
|
|||
// Avoid to have the same create time for a collection |
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.
Can you share the context on the need to sleep here?
}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
// Verify that the number of records returned is correct | ||
if len(suite.model.CollectionData[c]) > int(startOffset) { | ||
if len(suite.model.CollectionData[c])-int(startOffset) < int(batchSize) { |
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.
nit: Can we combine the if and else condition?
} | ||
} | ||
// Verify that the first record offset is correct | ||
if len(response.Records) > 0 { |
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.
nit: Do we also want to verify the other offsets?
Description of changes
Summarize the changes made by this PR.