Comments (3)
I was expecting to see something like this in zrep_refresh
From 0a41c5bb50b7082de005a4c672eb48ea28365eb3 Mon Sep 17 00:00:00 2001
From: Jan Vrany <jan@...>
Date: Tue, 20 Sep 2022 13:00:58 +0100
Subject: [PATCH] Fix resuming `zrep refresh`
In order to support resume of interrupted send, `zfs recv` must always
be called with `-s` option. This commit does so for `zrep refresh`.
---
zrep | 6 ++++--
zrep_sync | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/zrep b/zrep
index 2861c02..e5e64ae 100755
--- a/zrep
+++ b/zrep
@@ -2084,6 +2084,7 @@ zrep_sync(){
zrep_refresh(){
typeset srcfs destfs desthost newsnap newseq master
typeset force
+ typeset recv_s
if [[ "$ZREP_FORCE" == "-f" ]] ; then
force=-F
@@ -2134,16 +2135,17 @@ zrep_refresh(){
_debugprint refresh step 2: Pulling $newsnap
if [[ "$ZREP_RESUME" != "" ]] ; then
+ recv_s="-s"
token=`$ZFSGETVAL receive_resume_token $destfs`
if [[ "$token" == "-" ]] ; then token="" ; fi
fi
if [[ "$BBCP" != "" ]] ; then
$BBCP -N io "$srchost:$ZREP_PATH _refreshpull $newsnap $token" \
- "zfs recv $force $destfs"
+ "zfs recv $recv_s $force $destfs"
else
zrep_ssh $srchost "$ZREP_PATH ${ZREP_R} _refreshpull $newsnap $token ${Z_F_OUT}" |
- eval ${Z_F_IN} zfs recv $force $destfs
+ eval ${Z_F_IN} zfs recv $recv_s $force $destfs
fi
if [[ $? -ne 0 ]] ; then
zrep_errquit Unforseen error pulling snapshot $newsnap from $srchost
diff --git a/zrep_sync b/zrep_sync
index a43f8f3..0dc4f75 100644
--- a/zrep_sync
+++ b/zrep_sync
@@ -562,6 +562,7 @@ zrep_sync(){
zrep_refresh(){
typeset srcfs destfs desthost newsnap newseq master
typeset force
+ typeset recv_s
if [[ "$ZREP_FORCE" == "-f" ]] ; then
force=-F
@@ -612,16 +613,17 @@ zrep_refresh(){
_debugprint refresh step 2: Pulling $newsnap
if [[ "$ZREP_RESUME" != "" ]] ; then
+ recv_s="-s"
token=`$ZFSGETVAL receive_resume_token $destfs`
if [[ "$token" == "-" ]] ; then token="" ; fi
fi
if [[ "$BBCP" != "" ]] ; then
$BBCP -N io "$srchost:$ZREP_PATH _refreshpull $newsnap $token" \
- "zfs recv $force $destfs"
+ "zfs recv $recv_s $force $destfs"
else
zrep_ssh $srchost "$ZREP_PATH ${ZREP_R} _refreshpull $newsnap $token ${Z_F_OUT}" |
- eval ${Z_F_IN} zfs recv $force $destfs
+ eval ${Z_F_IN} zfs recv $recv_s $force $destfs
fi
if [[ $? -ne 0 ]] ; then
zrep_errquit Unforseen error pulling snapshot $newsnap from $srchost
--
2.35.1
from zrep.
from zrep.
Right, but zfs recv
is called without -s
regardless of recursive sync or not - at least this is my understanding of the code. ZFS manpage (at least on OpenZFS, do not have Solaris at hand) says:
-s If the receive is interrupted, save the partially received state, rather than delet-
ing it. Interruption may be due to...
so it seems to me that -s
has to be passed down to zfs recv
in order to make resume to work (whether we're resuming or not). And I do not see that in the code - obviously, I may well overlooked it.
from zrep.
Related Issues (20)
- Include ZREP_RESUME in user tunable section HOT 3
- delete non existing datasets on destination HOT 5
- don't sync on split brain HOT 25
- don't zrep_errquit in zrep_sync() while loop when using "all" HOT 2
- don't sync if not master HOT 7
- add check-for-remote parameter HOT 1
- fix code for #178 HOT 1
- possibility to add additional rcve parameters HOT 14
- zrep not updating/setting src-host / dest-host on the receiving side HOT 17
- don't destroy local fs if init is used wrong HOT 4
- zrep2 (bash) not working via cronjob HOT 1
- Is there an issue with zrep sync filesystem@snapshot? HOT 3
- [enhancement] Add support of netcat for initial replication HOT 1
- large_blocks error HOT 6
- ZREP_SKIP_EXPIRE should also affect remote expiration of snapshots
- ZREP_INC_FLAG="-I" not used with custom zrep tag HOT 3
- ZREP - Filesystem will not be mounted HOT 1
- After connection problems: cannot receive incremental stream: destination ... has been modified HOT 12
- Changeconfig -d not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zrep.