mirror of
https://github.com/zrepl/zrepl.git
synced 2024-12-22 15:11:16 +01:00
bbdc6f5465
Before this PR, we would panic in the `check` phase of `endpoint.Send()`'s `TryBatchDestroy` call in the following cases: the current protection strategy does NOT produce a tentative replication cursor AND * `FromVersion` is a tentative cursor bookmark * `FromVersion` is a snapshot, and there exists a tentative cursor bookmark for that snapshot * `FromVersion` is a bookmark != tentative cursor bookmark, but there exists a tentative cursor bookmark for the same snapshot as the `FromVersion` bookmark In those cases, the `check` concluded that we would delete `FromVersion`. It came to that conclusion because the tentative cursor isn't part of `obsoleteAbs` if the protection strategy doesn't produce a tentative replication cursor. The scenarios above can happen if the user changes the protection strategy from "with tentative cursor" to one "without tentative replication cursor", while there is a tentative replication cursor on disk. The workaround was to rename the tentative cursor. In all cases above, `TryBatchDestroy` would have destroyed the tentative cursor. In case 1, that would fail the `Send` step and potentially break replication if the cursor is the last common bookmark. The `check` conclusion was correct. In cases 2 and 3, deleting the tentative cursor would have been fine because `FromVersion` was a different entity than the tentative cursor. So, destroying the tentative cursor would be the right call. The solution in this PR is as follows: * add the `FromVersion` to the `liveAbs` set of live abstractions * rewrite the `check` closure to use the full dataset path (`fullpath`) to identify the concrete ZFS object instead of the `zfs.FilesystemVersionEqualIdentity`, which is only identified by matching GUID. * Holds have no dataset path and are not the `FromVersion` in any case, so disregard them. fixes #666
52 lines
2.3 KiB
Go
52 lines
2.3 KiB
Go
// Code generated by zrepl tooling; DO NOT EDIT.
|
|
|
|
package tests
|
|
|
|
var Cases = []Case{BatchDestroy,
|
|
CreateReplicationCursor,
|
|
GetNonexistent,
|
|
HoldsWork,
|
|
IdempotentBookmark,
|
|
IdempotentDestroy,
|
|
IdempotentHold,
|
|
ListFilesystemVersionsFilesystemNotExist,
|
|
ListFilesystemVersionsTypeFilteringAndPrefix,
|
|
ListFilesystemVersionsUserrefs,
|
|
ListFilesystemVersionsZeroExistIsNotAnError,
|
|
ListFilesystemsNoFilter,
|
|
ReceiveForceIntoEncryptedErr,
|
|
ReceiveForceRollbackWorksUnencrypted,
|
|
ReplicationFailingInitialParentProhibitsChildReplication,
|
|
ReplicationIncrementalCleansUpStaleAbstractionsWithCacheOnSecondReplication,
|
|
ReplicationIncrementalCleansUpStaleAbstractionsWithoutCacheOnSecondReplication,
|
|
ReplicationIncrementalDestroysStepHoldsIffIncrementalStepHoldsAreDisabledButStepHoldsExist,
|
|
ReplicationIncrementalHandlesFromVersionEqTentativeCursorCorrectly,
|
|
ReplicationIncrementalIsPossibleIfCommonSnapshotIsDestroyed,
|
|
ReplicationInitialAll,
|
|
ReplicationInitialFail,
|
|
ReplicationInitialMostRecent,
|
|
ReplicationIsResumableFullSend__both_GuaranteeResumability,
|
|
ReplicationIsResumableFullSend__initial_GuaranteeIncrementalReplication_incremental_GuaranteeIncrementalReplication,
|
|
ReplicationIsResumableFullSend__initial_GuaranteeResumability_incremental_GuaranteeIncrementalReplication,
|
|
ReplicationPlaceholderEncryption__EncryptOnReceiverUseCase__WorksIfConfiguredWithInherit,
|
|
ReplicationPlaceholderEncryption__UnspecifiedIsOkForClientIdentityPlaceholder,
|
|
ReplicationPlaceholderEncryption__UnspecifiedLeadsToFailureAtRuntimeWhenCreatingPlaceholders,
|
|
ReplicationPropertyReplicationWorks,
|
|
ReplicationReceiverErrorWhileStillSending,
|
|
ReplicationStepCompletedLostBehavior__GuaranteeIncrementalReplication,
|
|
ReplicationStepCompletedLostBehavior__GuaranteeResumability,
|
|
ResumableRecvAndTokenHandling,
|
|
ResumeTokenParsing,
|
|
SendArgsValidationEE_EncryptionAndRaw,
|
|
SendArgsValidationEncryptedSendOfUnencryptedDatasetForbidden__EncryptionSupported_false,
|
|
SendArgsValidationEncryptedSendOfUnencryptedDatasetForbidden__EncryptionSupported_true,
|
|
SendArgsValidationResumeTokenDifferentFilesystemForbidden,
|
|
SendArgsValidationResumeTokenEncryptionMismatchForbidden,
|
|
SendStreamCloseAfterBlockedOnPipeWrite,
|
|
SendStreamCloseAfterEOFRead,
|
|
SendStreamMultipleCloseAfterEOF,
|
|
SendStreamMultipleCloseBeforeEOF,
|
|
SendStreamNonEOFReadErrorHandling,
|
|
UndestroyableSnapshotParsing,
|
|
}
|