Skip to content

Commit

Permalink
update semantics.md for remove 0 byte file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmeenkaur committed Sep 22, 2023
1 parent e206490 commit 90a1bde
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions docs/semantics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,30 @@ Files that have not been modified are read portion by portion on demand. Cloud S

**Writes**

For modifications to existing objects, Cloud Storage FUSE downloads the entire backing object's contents from Cloud Storage. The contents are stored in a local temporary file whose location is controlled by the flag ```--temp-dir```. Later, when the file is closed or fsync'd, Cloud Storage FUSE writes the contents of the local file back to Cloud Storage as a new object generation. Modifying even a single bit of an object results in the full re-upload of the object. The exception is if an append is done to the end of a file, where the original file is at least 2MB, then only the appended content is uploaded.

For new objects, objects are first written to the same temporary directory as mentioned above, and you will notice an empty file is created in the Cloud Storage bucket as a hold. Upon closing or fsyncing the file, the file is then written to your Cloud Storage bucket, with the existing empty file now reflecting the accurate file size and content.

As new and modified files are fully staged in the local temporary directory until they are written out to Cloud Storage from being closed or fsync'd, you must ensure that there is enough free space available to handle staged content when writing large files.
For modifications to existing objects, Cloud Storage FUSE downloads the entire
backing object's contents from Cloud Storage. The contents are stored in a local
temporary file whose location is controlled by the flag ```--temp-dir```. Later,
when the file is closed or fsync'd, Cloud Storage FUSE writes the contents of
the local file back to Cloud Storage as a new object generation. Modifying even
a single bit of an object results in the full re-upload of the object. The
exception is if an append is done to the end of a file, where the original file
is at least 2MB, then only the appended content is uploaded.

For new objects, objects are first written to the same temporary directory as
mentioned above. Upon closing or fsyncing the file, the file is then written to
your Cloud Storage bucket.
As new and modified files are fully staged in the local temporary directory
until they are written out to Cloud Storage from being closed or fsync'd, you
must ensure that there is enough free space available to handle staged content
when writing large files.\
**Note:** Prior to version 1.2.0, you will notice that an empty file is created
in the Cloud Storage bucket as a hold. Upon closing or fsyncing the file, the
file is written to your Cloud Storage bucket, with the existing empty file now
reflecting the accurate file size and content. Starting with version 1.2, the
default behavior is to not create this zero-byte file, which increases write
performance. If needed, it can be re-enabled by setting
the `create-empty-file: true` configuration in the [config file](TODO: link
public documentation here).

**Concurrency**

Expand Down

0 comments on commit 90a1bde

Please sign in to comment.