Argument fix for read_chunk() when write_chunk() says 'written'

This commit is contained in:
Scott Lystig Fritchie 2015-10-14 14:16:51 +09:00
parent 6dbf52db6f
commit ed112bfb52
2 changed files with 2 additions and 2 deletions

View file

@ -554,7 +554,6 @@ write_chunk2(Sock, EpochID, File0, Offset, Chunk0) ->
{Tag, CS} = machi_util:unmake_tagged_csum(ChunkCSum),
{Chk, Tag, CS}
end,
%% io:format(user, "\n~s LINE ~w eid ~w File ~w Offset ~w Chunk0 ~w\n", [?MODULE, ?LINE, EpochID, File, Offset, Chunk0]),
Req = machi_pb_translate:to_pb_request(
ReqID,
{low_write_chunk, EpochID, File, Offset, Chunk, CSum_tag, CSum}),

View file

@ -298,7 +298,8 @@ write_chunk(PidSpec, EpochID, File, Offset, Chunk, Timeout) ->
case gen_server:call(PidSpec, {req, {write_chunk, EpochID, File, Offset, Chunk}},
Timeout) of
{error, written}=Err ->
case read_chunk(PidSpec, EpochID, File, Offset, Chunk, Timeout) of
Size = byte_size(Chunk),
case read_chunk(PidSpec, EpochID, File, Offset, Size, Timeout) of
{ok, Chunk2} when Chunk2 == Chunk ->
%% See equivalent comment inside write_projection().
ok;