Closed ps-gill closed 1 week ago
Looking into this one now
Just did a few minor tweaks so far:
There seems to be a problem with the actual logic:
root@v1:~# incus snapshot list a1
+-------+----------------------+------------+----------+
| NAME | TAKEN AT | EXPIRES AT | STATEFUL |
+-------+----------------------+------------+----------+
| snap0 | 2024/11/14 07:03 UTC | | NO |
+-------+----------------------+------------+----------+
| snap1 | 2024/11/14 07:03 UTC | | NO |
+-------+----------------------+------------+----------+
| snap2 | 2024/11/14 07:04 UTC | | NO |
+-------+----------------------+------------+----------+
| snap3 | 2024/11/14 07:04 UTC | | NO |
+-------+----------------------+------------+----------+
| snap4 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
| snap5 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
| snap6 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
| snap7 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
root@v1:~# incus snapshot list v2:a1
+-------+----------------------+------------+----------+
| NAME | TAKEN AT | EXPIRES AT | STATEFUL |
+-------+----------------------+------------+----------+
| snap6 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
| snap7 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
root@v1:~# incus copy a1 v2: --refresh-exclude-older --refresh
root@v1:~# incus snapshot list v2:a1
+-------+----------------------+------------+----------+
| NAME | TAKEN AT | EXPIRES AT | STATEFUL |
+-------+----------------------+------------+----------+
| snap0 | 2024/11/14 07:03 UTC | | NO |
+-------+----------------------+------------+----------+
| snap1 | 2024/11/14 07:03 UTC | | NO |
+-------+----------------------+------------+----------+
| snap2 | 2024/11/14 07:04 UTC | | NO |
+-------+----------------------+------------+----------+
| snap3 | 2024/11/14 07:04 UTC | | NO |
+-------+----------------------+------------+----------+
| snap4 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
| snap5 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
| snap6 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
| snap7 | 2024/11/14 07:05 UTC | | NO |
+-------+----------------------+------------+----------+
root@v1:~#
I fixed the issue. It was the exclude flag not being passed around through migrationSinkArgs combined with then a bad check in utils.go.
This pull request resolves issue https://github.com/lxc/incus/issues/745