Feature #53373
open[pwl] old data may lose if host IP change after restarting
0%
Description
If multiple clients successively write to the same image and go down halfway, and then the client that went down earlier starts to write back the cache data, the data may have expired and may overwrite the new data. For example, client A write cache and down, then client B write cache and down. Client A up and write back the exist dirty cache file to osd, may cause old data overwrite new data. Add instance id to guarantee last open request is on this client.
Updated by CONGMIN YIN over 2 years ago
https://github.com/ceph/ceph/pull/43839 is a feasible solution. Adding id in root structure, we'd better using string, but rwl use memory-copy-mode. Plan to change memory-copy(C style) to encode/decode(C++ style). And then consider structure has external data structure from libpmemobj, like TOID. So I will change rwl to encode/decode mode after changing libpmemobj to libpmem.
Updated by CONGMIN YIN over 2 years ago
- Subject changed from [pwl] old data may overwrite the new data to [pwl] old data may lose if host IP change after restarting
Updated by CONGMIN YIN over 2 years ago
The current design uses host IP to judge whether the existing cache file is valid, but in the distributed environment, the IP is often not fixed, so it is best to use UUID instead of IP. Otherwise, when the client restarts, the available cache will become unavailable as long as the IP changes.
bool ImageCacheState<I>::is_valid() {
if (this->present &&
(host.compare(ceph_get_short_hostname()) != 0)) {
auto cleanstring = "dirty";
...
}