remus: don't do failover if we don't have a consistent state

We will have a consistent state when a CHECKPOINT_END record
is received. After the first CHECKPOINT_END record is received,
we will buffer all records until the next CHECKPOINT_END record
is received. So if the checkpoint() callback returns XGR_CHECKPOINT_FAILOVER,
we only can do failover if ctx->restore.buffer_all_records is
true.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Wen Congyang authored and Ian Campbell committed 2016-01-20 17:08:36 +00:00
1 parent bf05e88ed7
commit 794347f5e3
1 file changed
+5 -1
+5 -1
View File
@@ -493,7 +493,11 @@ static int handle_checkpoint(struct xc_sr_context *ctx)
break;
case XGR_CHECKPOINT_FAILOVER:
rc = BROKEN_CHANNEL;
if ( ctx->restore.buffer_all_records )
rc = BROKEN_CHANNEL;
else
/* We don't have a consistent state */
rc = -1;
goto err;
default: /* Other fatal error */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.