Skip to content

Add support for incremental backups#1928

Open
dirkkul wants to merge 1 commit intomainfrom
incremental_backup_support
Open

Add support for incremental backups#1928
dirkkul wants to merge 1 commit intomainfrom
incremental_backup_support

Conversation

@dirkkul
Copy link
Collaborator

@dirkkul dirkkul commented Jan 22, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 22, 2026 12:11
Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for incremental backups to the Weaviate Python client by introducing a new base_backup_id parameter to the backup creation methods. This allows users to create incremental backups based on a previous backup.

Changes:

  • Added base_backup_id parameter to the create method signature across sync and async backup implementations
  • The parameter is mapped to incremental_backup_base_id in the API payload

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
weaviate/backup/executor.py Added base_backup_id parameter to the create method implementation and included it in the backup creation payload
weaviate/backup/sync.pyi Added base_backup_id parameter type hint to the sync backup create method stub
weaviate/backup/async_.pyi Added base_backup_id parameter type hint to the async backup create method stub

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

backend: BackupStorage,
include_collections: Union[List[str], str, None] = None,
exclude_collections: Union[List[str], str, None] = None,
base_backup_id: Optional[str] = None,
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The docstring for the create method is missing documentation for the new base_backup_id parameter. The docstring should include a description of this parameter in the Args section to explain its purpose for incremental backups.

Copilot uses AI. Check for mistakes.
backend: BackupStorage,
include_collections: Union[List[str], str, None] = None,
exclude_collections: Union[List[str], str, None] = None,
base_backup_id: Optional[str] = None,
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The new base_backup_id parameter lacks test coverage. Since the test file integration/test_backup_v4.py contains comprehensive backup tests, there should be at least one test case that verifies incremental backup functionality using this new parameter.

Copilot uses AI. Check for mistakes.
backend: BackupStorage,
include_collections: Union[List[str], str, None] = None,
exclude_collections: Union[List[str], str, None] = None,
base_backup_id: Optional[str] = None,
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

There is a naming inconsistency between the parameter name base_backup_id and the payload key incremental_backup_base_id. Consider renaming the parameter to incremental_backup_base_id for better clarity and consistency with the API payload, or if brevity is preferred, ensure this mapping is well-documented.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.38%. Comparing base (fd58638) to head (d745492).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1928      +/-   ##
==========================================
- Coverage   86.45%   86.38%   -0.07%     
==========================================
  Files         274      274              
  Lines       19966    19977      +11     
==========================================
- Hits        17261    17258       -3     
- Misses       2705     2719      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

backend: BackupStorage,
include_collections: Union[List[str], str, None] = None,
exclude_collections: Union[List[str], str, None] = None,
base_backup_id: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a more unambiguous name for this parameter?

IMO the fact that setting a "base backup id" (which looks and feels like a "default prefix for your backup IDs") changes the backup strategy is surprising.

Having a separate "backup_strategy" field would make the effect of using it clearer and allow adding some other strategy in the future (e.g. "scheduled" or sth)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a more unambiguous name for this parameter?

Happy to use another name, do you have any proposals?

Having a separate "backup_strategy" field would make the effect of using it clearer and allow adding some other strategy in the future (e.g. "scheduled" or sth)

Hmmm, not a fan of this:

  1. I am not sure if I would call incremental backups a "strategy"
  2. We don't have anything else planned that would fall under strategy
  3. If you would add any other strategy, it would mean that it is mutually exclusive with incremental backups. Why would "scheduled" mean that the backup is not incremental for example?

Copy link
Contributor

@bevzzz bevzzz Feb 12, 2026

Choose a reason for hiding this comment

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

I mean, "scheduled" is just as example (I guess a bad one heh) and "base backup id" could stay if the effect of setting it was clearer. My main concern is this:

the fact that setting a "base backup id" (which looks and feels like a "default prefix for your backup IDs") changes the backup strategy

If "incremental" is not exactly a strategy (doesn't fit in an enum) then perhaps it could be a boolean parameter?

Could the server (in principle) use a default "base backup id" if one wasn't provided?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As I said, I am happy to use a better name if you can think of one.

But I dont think adding a second parameter (it being an enum or a bool) makes things easier, but rather adds more failure cases:

  • bool set, but not the base backup id
  • bot not set, but base backup id

Could the server (in principle) use a default "base backup id" if one wasn't provided?

No

Copy link
Contributor

Choose a reason for hiding this comment

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

As I said, I am happy to use a better name if you can think of one.

I'd second this comment then: #1928 (comment)

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.

3 participants