Grokking Operating Systems and Networking for Backend Engineers
0% completed
What fsync Promises
n = os.pwrite(fd, data, 0)
That line wrote one Checkout order, 4,096 bytes, into a file, and it returned 4096, the full size. A moment later, the program asked the kernel to put the order on the disk, and the kernel answered [Errno 5] Input/output error. When the disk was checked afterward, the order was not there, although the program had been told that its write succeeded.
The demo broke the disk on purpose, but the gap it exposed exists on every Linux server. A successful write means that the kernel holds the data in memory
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%