# Cache Consistency: Frangipani

<http://nil.csail.mit.edu/6.824/2020/papers/thekkath-frangipani.pdf>

{% embed url="<http://nil.csail.mit.edu/6.824/2020/papers/frangipani-faq.txt>" %}

* I like they don't shy away from saying they didn't explore something or they haven't got enough experience with something.
* Small data blocks and large data blocks separately. Clever.
* Very decentralized. All the file system logic is on the clients.
  * Challenges with consistency then.

Challenges:

* Cache coherence.
* Atomicity.
* Crash recovery.

Coherence is solved with locks.

Atomic multi-step operations:

* Distributed transactions.
* First acquire all the locks I need. Then do all updates. Then release all the locks.
* But can crash in the middle of doing the updates. With locks.
  * Can't just release its locks.
  * So do write-ahead logging (WAL).
  * Separate per-workstation logs, in the shared storage.
  * Logs contain only metadata-changes, not file contents.
  * Log initially is in-memory; written to Petal only when it has to be.
* In revoke:
  * Write log to Petal.
  * Write modified blocks for locks.
  * Send release.
* If a workstation crashes while holding a lock, another workstation will replay its log! And only then the lock will he released.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.ainzzorl.lol/courses/mit-6.824-distributed-systems/cache-consistency-frangipani.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
