backup notifier fail policy
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int coroutine_fn backup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,
before_write);
BdrvTrackedRequest *req = opaque;
int64_t sector_num = req->offset >> BDRV_SECTOR_BITS;
int nb_sectors = req->bytes >> BDRV_SECTOR_BITS;
assert(req->bs == blk_bs(job->common.blk));
assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0);
assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
return backup_do_cow(job, sector_num, nb_sectors, NULL, true);
}So, what about something like
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) {
job->notif_ret = ret;
}
return 0;
and fail block job if notif_ret < 0 in other places of backup code?
Signature · 2 lines
Best regards, Vladimir
Quoted 25 lines · Vladimir Sementsov-Ogievskiy
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
Signature · 2 lines
Best regards, Vladimir
Quoted 38 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines · Vladimir Sementsov-Ogievskiy
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?
Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Stefan
Quoted 47 lines · Stefan Hajnoczi
Quoted 38 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines · Vladimir Sementsov-Ogievskiy
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
Quoted 9 lines
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Stefan
If we fail and intercept the error for the backup write and HALT at that point, why would we lose consistency? If the backup write failed before we allowed the guest write to proceed, that data should still be there on disk, no?
I guess it is a little messier than the usual STOP case, but it doesn't seem inherently impossible to me...
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
As for paused guarantees... good point. If you want to truly pause a backup job, I think you necessarily begin accruing a backlog of data that needs to get written back out. Maybe it's not easily possible to truly pause a backup block job.
I'm not exactly sure what we should do about it, though I do know that eventually we want to replace write notifiers with block filters, but even those would likely remain operating during a pause.
'busy' means something very specific within QEMU, but perhaps the query function can be adjusted to return 'true' for busy as long as either the job is running OR it has latent portions still running (write notifiers, block filters, etc.)
--js
Quoted 57 lines · John Snow
Quoted 54 lines · Stefan Hajnoczi
Quoted 38 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines · Vladimir Sementsov-Ogievskiy
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Quoted 7 lines
Quoted 2 lines
Stefan
If we fail and intercept the error for the backup write and HALT at that point, why would we lose consistency? If the backup write failed before we allowed the guest write to proceed, that data should still be there on disk, no?
I missed that there are two separate error handling approaches used in block/backup.c:
1. In the write notifier I/O errors are treated as if the guest write failed.
2. In the backup_run() loop I/O errors affect the block job's error status.
I was thinking of case #2 instead of case #1.
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
Stefan
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 75 lines · John Snow
Quoted 57 lines · Stefan Hajnoczi
Quoted 54 lines · Vladimir Sementsov-Ogievskiy
Quoted 38 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Quoted 7 lines
Quoted 2 lines
Stefan
If we fail and intercept the error for the backup write and HALT at that point, why would we lose consistency? If the backup write failed before we allowed the guest write to proceed, that data should still be there on disk, no?
I missed that there are two separate error handling approaches used in
block/backup.c:1. In the write notifier I/O errors are treated as if the guest write failed.
2. In the
backup_run()loop I/O errors affect the block job's error status.
Quoted 8 lines
I was thinking of case #2 instead of case #1.
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
That's a policy decision that ultimately only the user can make. For one user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started than keeping the VM running.
Kevin
Am 04.10.2016 um 12:41 hat Denis V. Lunev geschrieben:
Quoted 85 lines · Kevin Wolf
Quoted 84 lines
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 70 lines · John Snow
Quoted 54 lines · Stefan Hajnoczi
Quoted 52 lines · Vladimir Sementsov-Ogievskiy
Quoted 37 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Quoted 6 lines
Quoted 2 lines
Stefan
If we fail and intercept the error for the backup write and HALT at that point, why would we lose consistency? If the backup write failed before we allowed the guest write to proceed, that data should still be there on disk, no?
I missed that there are two separate error handling approaches used in
block/backup.c:1. In the write notifier I/O errors are treated as if the guest write failed.
2. In the
backup_run()loop I/O errors affect the block job's error status.Quoted 7 lines
I was thinking of case #2 instead of case #1.
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
That's a policy decision that ultimately only the user can make. For one user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started than keeping the VM running.
Quoted 3 lines
Quoted 1 line
Kevin
In this case policy for guest error and policy for backup error should be different policies or I have missed something.
I guess so.
Kevin
Quoted 78 lines · Kevin Wolf
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 70 lines · John Snow
Quoted 54 lines · Stefan Hajnoczi
Quoted 52 lines · Vladimir Sementsov-Ogievskiy
Quoted 37 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Quoted 6 lines
Quoted 2 lines
Stefan
If we fail and intercept the error for the backup write and HALT at that point, why would we lose consistency? If the backup write failed before we allowed the guest write to proceed, that data should still be there on disk, no?
I missed that there are two separate error handling approaches used in
block/backup.c:1. In the write notifier I/O errors are treated as if the guest write failed.
2. In the
backup_run()loop I/O errors affect the block job's error status.Quoted 7 lines
I was thinking of case #2 instead of case #1.
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
Quoted 7 lines
That's a policy decision that ultimately only the user can make. For one user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started than keeping the VM running.
Kevin
In this case policy for guest error and policy for backup error should be different policies or I have missed something.
Den
Quoted 86 lines · Kevin Wolf
Am 04.10.2016 um 12:41 hat Denis V. Lunev geschrieben:
Quoted 85 lines · Kevin Wolf
Quoted 84 lines
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 70 lines · John Snow
Quoted 54 lines · Stefan Hajnoczi
Quoted 52 lines · Vladimir Sementsov-Ogievskiy
Quoted 37 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Quoted 6 lines
Quoted 2 lines
Stefan
If we fail and intercept the error for the backup write and HALT at that point, why would we lose consistency? If the backup write failed before we allowed the guest write to proceed, that data should still be there on disk, no?
I missed that there are two separate error handling approaches used in
block/backup.c:1. In the write notifier I/O errors are treated as if the guest write failed.
2. In the
backup_run()loop I/O errors affect the block job's error status.Quoted 7 lines
I was thinking of case #2 instead of case #1.
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
That's a policy decision that ultimately only the user can make. For one user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started than keeping the VM running.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Kevin
In this case policy for guest error and policy for backup error should be different policies or I have missed something.
I guess so.
There are separate error policies for -device and the blockjob. Perhaps the blockjob error policy can be used in the write notifier code path if the failure occurs while writing to the backup target.
Stefan
Quoted 91 lines · Stefan Hajnoczi
Quoted 90 lines · Kevin Wolf
Am 04.10.2016 um 12:41 hat Denis V. Lunev geschrieben:
Quoted 88 lines · Kevin Wolf
Quoted 78 lines
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 70 lines · John Snow
Quoted 54 lines · Stefan Hajnoczi
Quoted 52 lines · Vladimir Sementsov-Ogievskiy
Quoted 37 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines
Hi all!
Please, can somebody explain me, why we fail guest request in case of io error in write notifier? I think guest consistency is more important than success of unfinished backup. Or, what am I missing?
I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL, true); }So, what about something like
Quoted 9 lines
ret = backup_do_cow(job, ...
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 7 lines
And second question about notifiers in backup block job. If block job is paused, notifiers still works and can copy data. Is it ok? So, user thinks that job is paused, so he can do something with target disk.. But really, this 'something' will race with write-notifiers. So, what assumptions may user actually have about paused backup job? Is there any agreements? Also, on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling since we lose snapshot consistency once guest writes are allowed to proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.
Quoted 6 lines
Quoted 2 lines
Stefan
If we fail and intercept the error for the backup write and HALT at that point, why would we lose consistency? If the backup write failed before we allowed the guest write to proceed, that data should still be there on disk, no?
I missed that there are two separate error handling approaches used in
block/backup.c:1. In the write notifier I/O errors are treated as if the guest write failed.
2. In the
backup_run()loop I/O errors affect the block job's error status.Quoted 7 lines
I was thinking of case #2 instead of case #1.
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
Quoted 7 lines
That's a policy decision that ultimately only the user can make. For one user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started than keeping the VM running.
Kevin
In this case policy for guest error and policy for backup error should be different policies or I have missed something.
Quoted 8 lines
Quoted 1 line
I guess so.
There are separate error policies for -device and the blockjob. Perhaps the blockjob error policy can be used in the write notifier code path if the failure occurs while writing to the backup target.
Stefan
Sounds good to me.
Quoted 117 lines · John Snow
Quoted 114 lines · Stefan Hajnoczi
Quoted 112 lines · Kevin Wolf
Am 04.10.2016 um 12:41 hat Denis V. Lunev geschrieben:
Quoted 106 lines · Kevin Wolf
Quoted 105 lines
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 89 lines · John Snow
Quoted 68 lines · Stefan Hajnoczi
Quoted 57 lines
Quoted 41 lines · Vladimir Sementsov-Ogievskiy
Quoted 31 lines · Vladimir Sementsov-Ogievskiy
Hi all!
Please, can somebody explain me, why we fail guest request in case of io
error in write notifier? I think guest consistency is more important
than success of unfinished backup. Or, what am I missing?I'm saying about this code:
static int
coroutine_fnbackup_before_write_notify(
NotifierWithReturn *notifier,
void *opaque)
{
BackupBlockJob *job = container_of(notifier, BackupBlockJob,before_write); BdrvTrackedRequest *req = opaque; int64_t sector_num = req->offset >> BDRV_SECTOR_BITS; int nb_sectors = req->bytes >> BDRV_SECTOR_BITS; assert(req->bs == blk_bs(job->common.blk)); assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0); return backup_do_cow(job, sector_num, nb_sectors, NULL,true);
}So, what about something like
ret = backup_do_cow(job, ...
Quoted 9 lines
if (ret < 0 && job->notif_ret == 0) { job->notif_ret = ret; }return 0;
and fail block job if
notif_ret< 0 in other places of backup code?Quoted 12 lines
And second question about notifiers in backup block job. If block job is
paused, notifiers still works and can copy data. Is it ok? So, user thinks
that job is paused, so he can do something with target disk.. But really,
this 'something' will race with write-notifiers. So, what assumptions may
user actually have about paused backup job? Is there any agreements? Also,
on query-block-jobs we will see job.busy = false, when actually copy-on-write may be in flight..I agree that the job should fail and the guest continues running.
Quoted 9 lines
The backup job cannot do the usual ENOSPC stop/resume error handling
since we lose snapshot consistency once guest writes are allowed to
proceed. Backup errors need to be fatal, resuming is usually not possible. The user will have to retry the backup operation.Stefan
Quoted 7 lines
If we fail and intercept the error for the backup write and HALT at that
point, why would we lose consistency? If the backup write failed before we
allowed the guest write to proceed, that data should still be there on disk,
no?I missed that there are two separate error handling approaches used in
block/backup.c:1. In the write notifier I/O errors are treated as if the guest write
failed.2. In the
backup_run()loop I/O errors affect the block job's error status.I was thinking of case #2 instead of case #1.
Quoted 7 lines
Quoted 5 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right
thing to do is definitely to just fail the backup instead of failing the
write.Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
That's a policy decision that ultimately only the user can make. For one
user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started
than keeping the VM running.Quoted 3 lines
Quoted 1 line
Kevin
In this case policy for guest error and policy for backup error should be different policies or I have missed something.
I guess so.
Quoted 8 lines
Quoted 6 lines
There are separate error policies for -device and the blockjob. Perhaps the blockjob error policy can be used in the write notifier code path if the failure occurs while writing to the backup target.
Stefan
Sounds good to me.
and to me this way. Cool.
Den
Am 04.10.2016 um 18:02 hat Stefan Hajnoczi geschrieben:
Quoted 17 lines · Kevin Wolf
Quoted 16 lines
Am 04.10.2016 um 12:41 hat Denis V. Lunev geschrieben:
Quoted 15 lines · Kevin Wolf
Quoted 14 lines
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 6 lines · John Snow
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
That's a policy decision that ultimately only the user can make. For one user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started than keeping the VM running.
Kevin
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
In this case policy for guest error and policy for backup error should be different policies or I have missed something.
I guess so.
There are separate error policies for -device and the blockjob. Perhaps the blockjob error policy can be used in the write notifier code path if the failure occurs while writing to the backup target.
Isn't the block job policy used for the background copy? Or do you think it's okay to use the same for both cases? That would mean that we stop the VM even if it's just a background copy that fails.
Kevin
Quoted 23 lines · Kevin Wolf
Am 04.10.2016 um 18:02 hat Stefan Hajnoczi geschrieben:
Quoted 22 lines · Kevin Wolf
Quoted 20 lines
Am 04.10.2016 um 12:41 hat Denis V. Lunev geschrieben:
Quoted 14 lines · Kevin Wolf
Quoted 13 lines
Am 04.10.2016 um 11:23 hat Stefan Hajnoczi geschrieben:
Quoted 6 lines · John Snow
Quoted 3 lines
Eh, regardless: If we're not using a STOP policy, it seems like the right thing to do is definitely to just fail the backup instead of failing the write.
Even with a -drive werror=stop policy the user probably doesn't want guest downtime if writing to the backup target fails.
That's a policy decision that ultimately only the user can make. For one user, it might be preferable to cancel the backup and keep the VM running, but for another user it may be more important to keep a consistent snapshot of the point in time when the backup job was started than keeping the VM running.
Quoted 3 lines
Quoted 1 line
Kevin
In this case policy for guest error and policy for backup error should be different policies or I have missed something.
I guess so.
Quoted 7 lines
Quoted 3 lines
There are separate error policies for -device and the blockjob. Perhaps the blockjob error policy can be used in the write notifier code path if the failure occurs while writing to the backup target.
Isn't the block job policy used for the background copy? Or do you think it's okay to use the same for both cases? That would mean that we stop the VM even if it's just a background copy that fails.
You're right, strictly speaking the guest notifier code path is a separate case and should have a dedicated parameter. At least if we want to allow users to select from all possible policy combinations...
Stefan