zrepl/endpoint
Christian Schwarz 5615f4929a
fix: replication of placeholder filesystems (#744)
fixes https://github.com/zrepl/zrepl/issues/742

Before this PR, when chaining replication from
A => B => C, if B had placeholders and the `filesystems`
included these placeholders, we'd incorrectly
fail the planning phase with error
`sender does not have any versions`.

The non-placeholder child filesystems of these placeholders
would then fail to replicate because of the
initial-replication-dependency-tracking that we do, i.e.,
their parent failed to initially replication, hence
they fail to replicate as well
(`parent(s) failed during initial replication`).

We can do better than that because we have the information
whether a sender-side filesystem is a placeholder.
This PR makes the planner act on that information.
The outcome is that placeholders are replicated as
placeholders (albeit the receiver remains in control
of how these placeholders are created, i.e., `recv.placeholders`)
The mechanism to do it is:
1. Don't plan any replication steps for filesystems that
   are placeholders on the sender.
2. Ensure that, if a receiving-side filesystem exists, it
   is indeed a placeholder.

Check (2) may seem overly restrictive, but, the goal here
is not just to mirror all non-placeholder filesystems, but
also to mirror the hierarchy.

Testing performed:
- [x] confirm with issue reporter that this PR fixes their issue
- [x] add a regression test that fails without the changes in this PR
2024-09-05 23:26:42 +02:00
..
context.go [#307] add package trace, integrate it with logging, and adopt it throughout zrepl 2020-05-19 11:30:02 +02:00
endpoint_abstractions_cache.go Reformat all files with make format. 2020-08-31 23:57:45 +02:00
endpoint_guarantees.go fix handling of tenative cursor presence if protection strategy doesn't use it (#714) 2023-07-04 20:21:48 +02:00
endpoint_metrics.go replication + endpoint: replication guarantees: guarantee_{resumability,incremental,nothing} 2020-07-26 20:32:35 +02:00
endpoint_zfs_abstraction_last_received_hold.go Reformat all files with make format. 2020-08-31 23:57:45 +02:00
endpoint_zfs_abstraction_replication_cursor.go run go1.19 gofmt and make adjustments as needed 2022-10-24 22:22:41 +02:00
endpoint_zfs_abstraction_step_hold.go replication + endpoint: replication guarantees: guarantee_{resumability,incremental,nothing} 2020-07-26 20:32:35 +02:00
endpoint_zfs_abstraction_test.go zfs.NilBool: document its purpose and move it to its own package 'nodefault' 2021-02-20 17:04:57 +01:00
endpoint_zfs_abstraction.go fix handling of tenative cursor presence if protection strategy doesn't use it (#714) 2023-07-04 20:21:48 +02:00
endpoint_zfs_helpers_repr_test.go endpoint: refactor, fix stale holds on initial replication failure, zfs-abstractions subcmd, more efficient ZFS queries 2020-04-18 12:26:03 +02:00
endpoint_zfs_helpers_repr.go endpoint: refactor, fix stale holds on initial replication failure, zfs-abstractions subcmd, more efficient ZFS queries 2020-04-18 12:26:03 +02:00
endpoint_zfs_helpers_types.go endpoint: refactor, fix stale holds on initial replication failure, zfs-abstractions subcmd, more efficient ZFS queries 2020-04-18 12:26:03 +02:00
endpoint.go fix: replication of placeholder filesystems (#744) 2024-09-05 23:26:42 +02:00
jobid.go replication + endpoint: replication guarantees: guarantee_{resumability,incremental,nothing} 2020-07-26 20:32:35 +02:00
placeholdercreationencryptionproperty_enumer.go fix encrypt-on-receive with placeholders 2021-12-18 15:12:47 +01:00
replicationguaranteekind_enumer.go replication + endpoint: replication guarantees: guarantee_{resumability,incremental,nothing} 2020-07-26 20:32:35 +02:00