Skip to content

Unnecessary chunks cache sync? #7278

@jdchristensen

Description

@jdchristensen

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yes. There's a chance this is related to #7274 , but I think it is probably different.

Is this a BUG / ISSUE report or a QUESTION?

BUG

System information. For client/server mode post info for both machines.

Ubuntu 22.04

Your borg version (borg -V).

borg 1.2.0. Also happens with master branch borg2.

Operating system (distribution) and version.

Ubuntu 22.04

Hardware / network configuration, and filesystems used.

N/A

How much data is handled by borg?

N/A

Full borg commandline that lead to the problem (leave away excludes and passwords)

See below.

Describe the problem you're observing.

When a host accesses a borg repo after another host has accessed it, sometimes some archives have their chunks cache synced even when they should already be in the cache. I first noticed it in #7277 (with borg2), where the line

Fetching and building archive index for host1test19

shouldn't be there, since that archive was made with the same host. Then I reproduced it with borg 1.2.0, using the steps shown below.

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

borg-test-sync$ mkdir host1 host2 test-data
borg-test-sync$ echo foo > test-data/foo
borg-test-sync$ export BORG_BASE_DIR=host1
borg-test-sync$ export BORG_REPO=test.repo
borg-test-sync$ borg init -e none
borg-test-sync$ borg create -v ::${BORG_BASE_DIR}-test1 ./test-data
Creating archive at "test.repo::host1-test1"
borg-test-sync$ borg create -v ::${BORG_BASE_DIR}-test2 ./test-data
Creating archive at "test.repo::host1-test2"
borg-test-sync$ export BORG_BASE_DIR=host2
borg-test-sync$ borg create -v ::${BORG_BASE_DIR}-test3 ./test-data
Warning: Attempting to access a previously unknown unencrypted repository!
Do you want to continue? [yN] y
Creating archive at "test.repo::host2-test3"
Synchronizing chunks cache...
Archives: 2, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 2.
Fetching and building archive index for host1-test1 ...
Merging into master chunks index ...
Fetching and building archive index for host1-test2 ...
Merging into master chunks index ...
Done.
borg-test-sync$ borg create -v ::${BORG_BASE_DIR}-test4 ./test-data
Creating archive at "test.repo::host2-test4"
borg-test-sync$ export BORG_BASE_DIR=host1
borg-test-sync$ borg create -v ::${BORG_BASE_DIR}-test5 ./test-data
Creating archive at "test.repo::host1-test5"
Synchronizing chunks cache...
Archives: 4, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 4.  <<<<<<
Fetching and building archive index for host1-test1 ...  *************
Merging into master chunks index ...
Fetching and building archive index for host1-test2 ...  *************
Merging into master chunks index ...
Fetching and building archive index for host2-test3 ...
Merging into master chunks index ...
Fetching and building archive index for host2-test4 ...
Merging into master chunks index ...
Done.

In this case, both archives made on "host1" have their data fetched, even though we are currently on host1. See the two lines marked with "******". Also, the line marked with "<<<<<<" shows that borg thinks there is nothing locally cached. In #7277, only one gets synced that shouldn't, so it is less extreme there. Not sure what is going on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions