Skip to content

GCS: FileWriter.Size: include number of buffered bytes if the FileWriter is not closed - #1703

Merged
RichardScothern merged 1 commit into
distribution:release/2.4from
aibaars:gcs-fix
May 5, 2016
Merged

RichardScothern merged 1 commit into
distribution:release/2.4from
aibaars:gcs-fix

Conversation

@aibaars

@aibaars aibaars commented May 5, 2016

Copy link
Copy Markdown
Contributor

@RichardScothern This is a quick patch for #1698. Note that this PR targets the release/2.4 branch instead of master. I am not sure this is the right way of submitting a "hot fix" to a release.

@aaronlehmann The cause of the problem is that the registry calls the FileWriter.Size function of the GCS driver before closing the FileWriter. The Size function of the GCS driver used to report the number of bytes that were correctly saved to cloud storage. This excludes any bytes that are buffered in memory. The registry seems to expect that the Size function returns the size including the buffered bytes, regardless of whether these bytes will ever make it to the backing storage (the future Close call may occasionally fail).

In my opinion Size should report only the bytes that are guaranteed to have made it to the backing storage. However, changing that requires changes to the registry code and possible the other storage drivers. So for now, I think this PR is a good enough patch to ensure the GCS driver works again.

@aibaars

aibaars commented May 5, 2016

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1705

@aibaars aibaars closed this May 5, 2016
@aibaars

aibaars commented May 5, 2016

Copy link
Copy Markdown
Contributor Author

@RichardScothern

@aibaars aibaars reopened this May 5, 2016
@RichardScothern

Copy link
Copy Markdown

LGTM

@dmcgowan

dmcgowan commented May 5, 2016

Copy link
Copy Markdown
Collaborator

LGTM

1 similar comment
@aaronlehmann

Copy link
Copy Markdown

LGTM

@RichardScothern
RichardScothern merged commit 1e0f3b7 into distribution:release/2.4 May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants