Merge pull request #12901 from keynslug/fix/ds-snap-flaky-tc
fix(dssnap): ensure idempotent write of empty chunks
This commit is contained in:
commit
ebc02cd39d
|
@ -267,7 +267,9 @@ new_writer_file(#writer{dirpath = DirPath}, RelPath) ->
|
||||||
|
|
||||||
write_chunk_file(WFile0 = #wfile{fd = IoDev, pos = Pos, abspath = AbsPath}, Pos, More, Chunk) ->
|
write_chunk_file(WFile0 = #wfile{fd = IoDev, pos = Pos, abspath = AbsPath}, Pos, More, Chunk) ->
|
||||||
ChunkSize = byte_size(Chunk),
|
ChunkSize = byte_size(Chunk),
|
||||||
case file:write(IoDev, Chunk) of
|
case (ChunkSize > 0) andalso file:write(IoDev, Chunk) of
|
||||||
|
false ->
|
||||||
|
WFile0;
|
||||||
ok ->
|
ok ->
|
||||||
WFile1 = WFile0#wfile{pos = Pos + ChunkSize},
|
WFile1 = WFile0#wfile{pos = Pos + ChunkSize},
|
||||||
case More of
|
case More of
|
||||||
|
|
Loading…
Reference in New Issue