junneyang / zumastor

Automatically exported from code.google.com/p/zumastor
0 stars 1 forks source link

Writes to the origin sometimes fail #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It seems that sometimes userspace sees a write complete for less than the
full amount requested.  AFAIK this is unexpected and unacceptable, as most
apps do not check that write requests complete successfully.

The test results for commits 1715 and 1726 show that this problem occurs
only sometimes.  In both cases, the snapshot-microtests script is
initializing the device to a known state when dd prints "0+1" meaning that
the full record was not written. (chunk 13 for 1715 and chunk 4 for 1726)

Original issue reported on code.google.com by vand...@gmail.com on 10 Jul 2008 at 8:17

GoogleCodeExporter commented 9 years ago
Hi Steve,

Could you try to put a 'sync' after 'dd' in writedisk() and see if it helps to 
solve
the problem? There may be some in-flight IOs between the time it takes a 
snapshot and
the time of checking.

Jiaying

Original comment by jiahotc...@gmail.com on 18 Jul 2008 at 2:49

GoogleCodeExporter commented 9 years ago
A 'sync' after 'dd' in writedisk() will not help to solve the problem:  The log
suggests that that 'dd' sees an error or a short write returned from the kernel 
(it
prints 0+1), therefore no matter how synchronous we make the processes there 
will be
blocks that don't have the data we want them to have.  i.e. the kernel has 
given up
on part of a write and told userspace about it, no amount of syncing will get 
it to
disk because the kernel has given up.

Also FYI, this occurs on the origin before any snapshots have been created.

Original comment by vand...@gmail.com on 18 Jul 2008 at 5:17