-
Notifications
You must be signed in to change notification settings - Fork 34
Add incremental backup support #459
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?
Changes from all commits
0ab941e
1ff1593
e15b399
f493925
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| export type { Backup } from './client.js'; | ||
| export type { BackupCollection, BackupCollectionArgs } from './collection.js'; | ||
| export type { BackupArgs, BackupConfigCreate, BackupConfigRestore, BackupStatusArgs } from './types.js'; | ||
| export type { BackupCollection, BackupCollectionArgs, BackupCollectionCreateArgs } from './collection.js'; | ||
| export type { | ||
| BackupArgs, | ||
| BackupConfigCreate, | ||
| BackupConfigRestore, | ||
| BackupCreateArgs, | ||
| BackupStatusArgs, | ||
| } from './types.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,6 +163,13 @@ export class DbVersionSupport { | |
| message: this.errorMessage('Tokenize endpoint stopwords / stopwordPresets', version.show(), '1.37.2'), | ||
| })); | ||
|
|
||
| supportsIncrementalBackups = () => | ||
| this.dbVersionProvider.getVersion().then((version) => ({ | ||
| version, | ||
| supports: version.isAtLeast(1, 37, 0), | ||
|
Contributor
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. 1.37.0 is too high. I ran 1.36.10 and the server accepted the field and produced a genuine incremental. Tag scan says Worth splitting this into two checks, since the read-back has a different floor (~1.37.6).
Contributor
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. Actually maybe we can ignore this one, as I see that Python also uses 1.37.0
Contributor
Author
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. Taking your follow-up — keeping the floor at 1.37.0 so we stay in step with Python ( Your tag scan checks out on my side too: the incremental-create merge |
||
| message: this.errorMessage('Incremental backups', version.show(), '1.37.0'), | ||
| })); | ||
|
|
||
| supportsServerSideDefaultVectorIndexType = () => | ||
| this.dbVersionProvider.getVersion().then((version) => ({ | ||
| version, | ||
|
|
||
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.
This path skips both the version gate and the lowercasing that
client.tsdoes, andvalidate()at :95 compares raw, sobackupId: 'B1'with base'b1'gets through.weaviateV2is public API.Lowercasing here would fix the validate case for free.
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.
Fixed both halves.
withIncrementalBaseBackupIdnow lowercases, andvalidateIncrementalBaseBackupIdcompares case-insensitively. That second part matters for the exact case you named: lowercasing the base alone would not catchbackupId: 'B1'+ base'b1', because the primary ID keeps its casing on the v2 path.I also added the version gate rather than leaving it to v3.
BackupCreatortakes an optionalDbVersionSupportanddo()checks it before posting;weaviateV2.client()passes it through. Worth having given you confirmed 1.35.0 silently produces a full backup — a silent full backup is exactly the failure the gate exists to prevent. Mock coverage underwith the v2 builderandshould throw from the v2 builder too.The v3 path now delegates the lowercasing to the builder instead of doing its own.