Risk of Data Loss with Defer-Write on SSD cache?
Posted: Sun Feb 16, 2020 12:11 am
Hi.
The documentation describes defer-write as a feature to accelerate writes, but warns that there is a risk of data loss if there is an outage before writing to the main disk is complete.
This is perfectly clear in the case of RAM cache. But if the cache is an SSD, it's not so clear - SSD is nonvolatile, so even if there is an outage before the data is written to the main HDD, the data should be safe as long as it has finished being written to the SSD cache.
I expected the documentation to specify this - that the L2 SSD cache is exempt from the data loss risk - but could not find such a provision.
So my primary question is - if defer-write is used, and there is an outage between the time the data finished being written to SSD, but before being written to HDD, can PrimoCache seamlessly recover the data (and finish the task of writing to HDD when the system is back up again)?
More concretely - assuming that I have a main HDD, an SSD I'm using as L2 cache, and optionally also L1 RAM cache. I want the data to be safe once written to SSD, and I don't want to wait for HDD speeds to complete the write.
Ideally, what I'd like is the following:
1. When there is a write task, writing to the SSD begins immediately.
2. The write will not be considered complete by the OS until the data is written to SSD.
3. Writing to HDD will be done at leisure.
4. If there is an outage before writing to HDD, the data will be safe and be recovered seamlessly, as it has already been written to SSD.
Is the above arrangement possible?
Slightly less ideal but also satisfactory is the following:
1. When there is a write, it is first written to L1 RAM cache.
2. The write is considered complete once written to RAM.
3. Quickly afterwards (~1 second), the data starts being written to SSD. (Writing to HDD will either be concurrent, or deferred to a future leisure time).
4. If there is an outage, the data will be lost if it was not yet written to SSD, even though the OS considered the write complete. However, if the write to SSD happened to be finished already, the data will be safe, regardless of whether writing to the HDD is complete.
Is this possible?
In both cases, how should I configure PrimoCache to achieve the desired effect?
Note - I have not yet installed PrimoCache. I'm considering using it as part of the setup for my next system. I'm trying to figure out whether it's suitable for my needs.
Thanks.
The documentation describes defer-write as a feature to accelerate writes, but warns that there is a risk of data loss if there is an outage before writing to the main disk is complete.
This is perfectly clear in the case of RAM cache. But if the cache is an SSD, it's not so clear - SSD is nonvolatile, so even if there is an outage before the data is written to the main HDD, the data should be safe as long as it has finished being written to the SSD cache.
I expected the documentation to specify this - that the L2 SSD cache is exempt from the data loss risk - but could not find such a provision.
So my primary question is - if defer-write is used, and there is an outage between the time the data finished being written to SSD, but before being written to HDD, can PrimoCache seamlessly recover the data (and finish the task of writing to HDD when the system is back up again)?
More concretely - assuming that I have a main HDD, an SSD I'm using as L2 cache, and optionally also L1 RAM cache. I want the data to be safe once written to SSD, and I don't want to wait for HDD speeds to complete the write.
Ideally, what I'd like is the following:
1. When there is a write task, writing to the SSD begins immediately.
2. The write will not be considered complete by the OS until the data is written to SSD.
3. Writing to HDD will be done at leisure.
4. If there is an outage before writing to HDD, the data will be safe and be recovered seamlessly, as it has already been written to SSD.
Is the above arrangement possible?
Slightly less ideal but also satisfactory is the following:
1. When there is a write, it is first written to L1 RAM cache.
2. The write is considered complete once written to RAM.
3. Quickly afterwards (~1 second), the data starts being written to SSD. (Writing to HDD will either be concurrent, or deferred to a future leisure time).
4. If there is an outage, the data will be lost if it was not yet written to SSD, even though the OS considered the write complete. However, if the write to SSD happened to be finished already, the data will be safe, regardless of whether writing to the HDD is complete.
Is this possible?
In both cases, how should I configure PrimoCache to achieve the desired effect?
Note - I have not yet installed PrimoCache. I'm considering using it as part of the setup for my next system. I'm trying to figure out whether it's suitable for my needs.
Thanks.