Skip to contentSkip to conversation

fix Remus failover regression

PATCH Superseded Yang Hongyang 3 participants 5 messages Jul 28, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix Remus failover regression

commit: c2ba706c
tools/libxc: goto correct label on error paths by Andrew broke Remus in Xen 4.4 or earlier versions that has this commit backported.

With Remus, this jump essentially discards the last incomplete checkpoint received by the backup.
This is required for Remus to work and this does not break live migration.

CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Andrew Cooper <[email protected]>
CC Shriram Rajagopalan <[email protected]>
---
 tools/libxc/xc_domain_restore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxc/xc_domain_restore.c +2 -2
index e73e0a2..5d2fbd6 100644
@@ -1783,14 +1783,14 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
 
     if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
         PERROR("error when buffering batch, finishing");
-        goto out;
+        goto finish;
     }
     memset(&tmptail, 0, sizeof(tmptail));
     tmptail.ishvm = hvm;
     if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
                      ext_vcpucontext, vcpuextstate_size) < 0 ) {
         ERROR ("error buffering image tail, finishing");
-        goto out;
+        goto finish;
     }
     tailbuf_free(&tailbuf);
     memcpy(&tailbuf, &tmptail, sizeof(tailbuf));
Signature · 1 line
1.9.1
#1 lore raw
Quoted 15 lines · Yang Hongyang

commit: c2ba706c
tools/libxc: goto correct label on error paths by Andrew broke Remus in Xen 4.4 or earlier versions that has this commit backported.

With Remus, this jump essentially discards the last incomplete checkpoint received by the backup.
This is required for Remus to work and this does not break live migration.

CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Andrew Cooper <[email protected]>
CC Shriram Rajagopalan <[email protected]>

Review

Quoted 5 lines
---
 tools/libxc/xc_domain_restore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/tools/libxc/xc_domain_restore.c

tools/libxc/xc_domain_restore.c int xc_domain_restore(xc_interface *xch, int

Quoted 4 lines

index e73e0a2..5d2fbd6 100644

tools/libxc/xc_domain_restore.c +0 -0
@@ -1783,14 +1783,14 @@ int xc_domain_restore(xc_interface *xch, int

io_fd, uint32_t dom,

Quoted 17 lines
tools/libxc/xc_domain_restore.c +2 -3
     if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
         PERROR("error when buffering batch, finishing");
-        goto out;
+        goto finish;
     }
     memset(&tmptail, 0, sizeof(tmptail));
     tmptail.ishvm = hvm;
     if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
                      ext_vcpucontext, vcpuextstate_size) < 0 ) {
         ERROR ("error buffering image tail, finishing");
-        goto out;
+        goto finish;
     }
     tailbuf_free(&tailbuf);
     memcpy(&tailbuf, &tmptail, sizeof(tailbuf));
--
Quoted 2 lines

1.9.1

Can you please add the comment about discarding the incomplete checkpoint on top of the two goto statements?

Otherwise things look ok to me.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to Yang Hongyang

At 07/28/2014 11:35 AM, Yang Hongyang Write:

Quoted 30 lines

commit: c2ba706c
tools/libxc: goto correct label on error paths by Andrew broke Remus in Xen 4.4 or earlier versions that has this commit backported.

With Remus, this jump essentially discards the last incomplete checkpoint received by the backup.
This is required for Remus to work and this does not break live migration.

CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Andrew Cooper <[email protected]>
CC Shriram Rajagopalan <[email protected]>
---
 tools/libxc/xc_domain_restore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxc/xc_domain_restore.c +1 -1
index e73e0a2..5d2fbd6 100644
@@ -1783,14 +1783,14 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
 
     if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
         PERROR("error when buffering batch, finishing");
-        goto out;
+        goto finish;
     }

tools/libxc/xc_domain_restore.c int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, · line 1796

Quoted 10 lines
tools/libxc/xc_domain_restore.c +1 -1
     memset(&tmptail, 0, sizeof(tmptail));
     tmptail.ishvm = hvm;
     if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
                      ext_vcpucontext, vcpuextstate_size) < 0 ) {
         ERROR ("error buffering image tail, finishing");
-        goto out;
+        goto finish;
     }
     tailbuf_free(&tailbuf);
     memcpy(&tailbuf, &tmptail, sizeof(tailbuf));

The mail is here:
http://lists.xenproject.org/archives/html/xen-devel/2014-01/msg02299.html

Quoted 3 lines

Both of these errors have been discovered by xc_domain_restore() returning success after suffering a fatal error during migration, leading to the toolstack believing that the VM migrated successfully.

These codes are only for Remus. So, why these codes are executed by migration?

Thanks
Wen Congyang

#3 lore raw
Quoted 45 lines · Wen Congyang

At 07/28/2014 11:35 AM, Yang Hongyang Write:

Quoted 30 lines

commit: c2ba706c
tools/libxc: goto correct label on error paths by Andrew broke Remus in Xen 4.4 or earlier versions that has this commit backported.

With Remus, this jump essentially discards the last incomplete checkpoint received by the backup.
This is required for Remus to work and this does not break live migration.

CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Andrew Cooper <[email protected]>
CC Shriram Rajagopalan <[email protected]>
---
  tools/libxc/xc_domain_restore.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxc/xc_domain_restore.c +1 -1
index e73e0a2..5d2fbd6 100644
@@ -1783,14 +1783,14 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
 
      if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
          PERROR("error when buffering batch, finishing");
-        goto out;
+        goto finish;
      }

tools/libxc/xc_domain_restore.c int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, · line 1796

Quoted 10 lines
tools/libxc/xc_domain_restore.c +1 -1
      memset(&tmptail, 0, sizeof(tmptail));
      tmptail.ishvm = hvm;
      if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
                       ext_vcpucontext, vcpuextstate_size) < 0 ) {
          ERROR ("error buffering image tail, finishing");
-        goto out;
+        goto finish;
      }
      tailbuf_free(&tailbuf);
      memcpy(&tailbuf, &tmptail, sizeof(tailbuf));

The mail is here:
http://lists.xenproject.org/archives/html/xen-devel/2014-01/msg02299.html

Quoted 5 lines
Quoted 3 lines

Both of these errors have been discovered by xc_domain_restore() returning success after suffering a fatal error during migration, leading to the toolstack believing that the VM migrated successfully.

These codes are only for Remus. So, why these codes are executed by migration?

I was confused also, without Remus, these two error path will not be hitted I think, without Remus, migration will ended at:
1776 if ( ctx->last_checkpoint )
1777 {
1778 // DPRINTF("Last checkpoint, finishing\n");
1779 goto finish;
1780 }

Quoted 7 lines

Thanks
Wen Congyang

.

Signature · 2 lines
Thanks,
Yang.
#4 lore raw
Quoted 25 lines · Hongyang Yang
Quoted 21 lines · Wen Congyang

At 07/28/2014 11:35 AM, Yang Hongyang Write:

Quoted 19 lines

commit: c2ba706c
tools/libxc: goto correct label on error paths by Andrew broke Remus in Xen 4.4 or earlier versions that has this commit backported.

With Remus, this jump essentially discards the last incomplete checkpoint received by the backup.
This is required for Remus to work and this does not break live migration.

CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Andrew Cooper <[email protected]>
CC Shriram Rajagopalan <[email protected]>
---
  tools/libxc/xc_domain_restore.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/tools/libxc/xc_domain_restore.c

Quoted 4 lines
Quoted 4 lines

tools/libxc/xc_domain_restore.c int xc_domain_restore(xc_interface *xch, int

Quoted 4 lines

index e73e0a2..5d2fbd6 100644

tools/libxc/xc_domain_restore.c +0 -0
@@ -1783,14 +1783,14 @@ int xc_domain_restore(xc_interface *xch, int

io_fd, uint32_t dom,

Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
tools/libxc/xc_domain_restore.c +2 -2
      if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
          PERROR("error when buffering batch, finishing");
-        goto out;
+        goto finish;
      }
      memset(&tmptail, 0, sizeof(tmptail));
      tmptail.ishvm = hvm;
      if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
                       ext_vcpucontext, vcpuextstate_size) < 0 ) {
          ERROR ("error buffering image tail, finishing");
-        goto out;
+        goto finish;
      }
      tailbuf_free(&tailbuf);
      memcpy(&tailbuf, &tmptail, sizeof(tailbuf));
 
Quoted 4 lines
Quoted 4 lines

The mail is here:
http://lists.xenproject.org/archives/html/xen-devel/2014-01/msg02299.html

Quoted 1 line

Both of these errors have been discovered by xc_domain_restore()

returning

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

success after suffering a fatal error during migration, leading to the toolstack believing that the VM migrated successfully.

These codes are only for Remus. So, why these codes are executed by

migration?

Quoted 1 line

I am not familiar with the XenServer code base. I don't know if it has Remus support. So the xc_domain_restore.c file may or may not be the same between Xen and XenServer. Please correct me if I am wrong.

Also, can those errors encountered in XenServer be reproduced in Xen 4.4?

Finally, goto finish vs goto out can be if-elsed by checking the ctx->complete and the ctx->last_checkpoint variables, to distinguish between a failure during mid-migragion vs mid-checkpoint. I haven't thought about this fully.

Quoted 2 lines

I was confused also, without Remus, these two error path will not be

hitted I

Quoted 12 lines

think, without Remus, migration will ended at:
1776 if ( ctx->last_checkpoint )
1777 {
1778 // DPRINTF("Last checkpoint, finishing\n");
1779 goto finish;
1780 }

Quoted 5 lines

Thanks
Wen Congyang

Quoted 7 lines
Quoted 2 lines

.

--
Thanks,
Yang.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel