Score:-1

disk cache mode: "write back" vs "write through" in iscsi context

la flag

I have a few iscsi drives connected to a debian. The iscsi drive (sde,sdg, one for each path) and the multipath device (dm-25) have the "write_cache" property (/sys/devices/virtual/block/dm-XX/queue/write_cache or /sys/block/sdX/queue/write_cache ) set as "write back". I can set the writecache mode to "write through".

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?

If I set this to "writethrough", does this mean that an iscsi write command will be ACKed if the command is succesfully communicated over the iscsi TCP connection?

Thanx!

cn flag
This would be drive caching. Drives where data integrity is a concern (databases) usually have write caching disabled (write through). SCSI also implements commands to control this (Forced Unit Access or FILE_FLAG_NO_BUFFERING). https://techcommunity.microsoft.com/t5/sql-server-blog/sql-server-on-linux-forced-unit-access-fua-internals/ba-p/3199102
Score:1
ru flag

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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.