Ankit Patel
WritingPapersLabsAboutContact
Paper Reviews··1 min read·121 views

GFS Record Append: Atomic Doesn't Mean Once

Google File System · Ghemawat, Gobioff, and Leung, SOSP 2003

A file written by record append can hold the same record twice and a stretch of padding, and the reader is expected to cope

In the 2003 Google File System paper, a successful record append writes data atomically at least once at an offset chosen by GFS.

Ghemawat, Gobioff, and Leung pack two distinct guarantees into that single sentence. Every committed append lands as one contiguous, intact byte sequence without interleaving bytes from concurrent writers. At the same time, retry paths after replica failures can leave padding, partial fragments, and full duplicate copies of that intact record earlier in the file.

Supporting hundreds of concurrent producers appending to one shared log without heavy distributed locking made GFS remarkably practical for Google's batch pipelines. Pushing cleanup upward required strict co-design with readers. Checksums inside application records let readers discard padding and torn fragments, while unique serial IDs let downstream consumers filter out duplicate appends when exact counts mattered.

Section 3.3 calls out an explicit division of labor I keep coming back to: Google's shared record-I/O library stripped padding and verified checksums automatically, leaving duplicate elimination to batch jobs like MapReduce or sorted storage layers like Bigtable where indexed keys already lived.

Checksum validation keeps bytes intact without making record delivery exactly-once. If an event-counting consumer validates checksums and increments a counter per valid record, it skips torn fragments cleanly while double-counting every retried append. Eliminating duplicates requires bounded state or idempotent keys partitioned to the same sink shard.

Whenever a team subscribes to a shared event log, the read contract needs three explicit answers: whether corrupt fragments are already stripped, whether retries emit duplicate records, and what retention window bounds replay. Treating "atomic" as a synonym for "once" hides the half of the job GFS deliberately left above storage.

Continue in Paper Reviews