I am trying to understand what is the meaning of "writeback" and "writethrough" in the iscsi context. Does the iscsi driver offers some kind of local caching?
It might. There also might be some caching at the file-system level, with the same implications.
Write through means that a write operation is synchronous - the data is put in cache and written to disk. Once that has finished control returns to the file system or the application - that way it always knows which piece of data has made it to permanent storage.
Write back is an asynchronous write operation - data is put in cache, a write-to-disk operation is queued and control immediately returns to the file system/application. There's no way to know whether all data has made it to permanent storage. It eventually should but if the power fails in between or if there's a hard crash it might not.
Write back is somewhat dangerous with local storage (so we use battery-backed cache) but it's much more dangerous with network storage - because there is so much more that can go wrong. Without proper setup, write back caching can seriously damage or even destroy a good journaling file system.
A proper setup includes:
- redundant power for servers
- redundant power for storage
- redundant UPS
- redundant network paths
- good monitoring, so any failure doesn't go unnoticed with all that redundancy