-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syncoid: Data loss because getoldestsnapshot()
might not choose the first snapshot
#815
Comments
getoldestsnapshot()
might not choose the first snapshotgetoldestsnapshot()
might not choose the first snapshot
imho we can require that the system time is correct and shouldn't work around configuration issues. @Deltik but you can work around the described issue if you use the "--no-rollback" option. In you example syncoid will then exit with an error and you can fix the wrong system time. |
@phreaker0: I meant that if the system clock was wrong in the past, |
I see but I think we still want to rely on the timestamps of snapshots. But if it would be possible without breaking anything else to switch to something like the transaction id of a snapshot or something stable we can consider it. |
Looking at the source, I see that
|
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots. There are no other usages of `getoldestsnapshot()` besides this initial sync, so there is practically no regression potential of this change. Fixes: jimsalterjrs#815
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots. There are no other usages of `getoldestsnapshot()` besides this initial sync, so there is practically no regression potential of this change. Fixes: jimsalterjrs#815
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots. There are no other usages of `getoldestsnapshot()` besides this initial sync, so there is practically no regression potential of this change. Fixes: jimsalterjrs#815
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots. There are no other usages of `getoldestsnapshot()` besides this initial sync, so there is practically no regression potential of this change. Fixes: jimsalterjrs#815
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
The `getsnaps` subroutine now retrieves the "createtxg" property of the snapshot. This is necessary to support the fix for jimsalterjrs#815 (Syncoid: Data loss because getoldestsnapshot() might not choose the first snapshot).
It is possible for `creation` of a subsequent snapshot to be in the past compared to the current snapshot due to system clock discrepancies, which leads to earlier snapshots not being replicated in the initial syncoid sync. Also, `syncoid --no-sync-snap` might not pick up the most recently taken snapshot if the clock moved backwards before taking that snapshot. Sorting snapshots by the `createtxg` value is reliable and documented in `man 8 zfsprops` as the proper way to order snapshots, but it was not available in ZFS versions before 0.7. To maintain backwards compatibility, the sorting falls back to sorting by the `creation` property, which was the old behavior. Fixes: jimsalterjrs#815
See jimsalterjrs#815 for the original test.
Bug Description
Due to an incorrect clock at the time, I have some snapshots where the
creation
property is in the past compared to earlier snapshots.When
syncoid
performs an initial full transfer of a dataset, it could select a snapshot that isn't the first snapshot of the dataset because of the usage ofgetoldestsnapshot()
. This leads to data loss, as some snapshots may be left behind.How to Reproduce
See the bold parts of the output below:
Expected Behavior
All snapshots are copied in the initial full sync, not just from the oldest-by-
creation
snapshot onwards.The text was updated successfully, but these errors were encountered: