gpt4 book ai didi

python - 删除不适用于 aerospike 持久存储的记录

转载 作者:太空宇宙 更新时间:2023-11-03 15:03:03 24 4
gpt4 key购买 nike

我正在为 Aerospike 使用持久存储。下面是相同的配置。当我使用删除 key 时,我正在使用 python 客户端:

client.remove(key)

数据被删除。现在当我重新启动服务器时,数据又回来了。它应该如何工作还是我做错了什么?

配置文件:

namespace xxx {
replication-factor 2
memory-size 2G
default-ttl 60d # 5 days, use 0 to never expire/evict.


# To use file storage backing, comment out the line above and use the
# following lines instead.
storage-engine device {
file /opt/aerospike/data/xxx.dat
filesize 4G
data-in-memory true # Store data in memory in addition to file.
write-block-size 128K
}

}

是否有相同的解决方法?

最佳答案

我在 Aerospike 工作,它在解决这种行为的路线图上。

这是预料之中的。当删除发生时,对记录的引用从索引中删除,但记录本身保留在写 block 中,直到用新数据重写该写 block 。当发生冷启动时,从磁盘读取数据时,未被重写的 block 可能已经删除了读取的记录,系统无法知道这些记录已被删除。所以删除的数据可以恢复。

这里详细讨论了这一点:

https://discuss.aerospike.com/t/expired-deleted-data-reappears-after-server-is-restarted/470

请注意,这仅适用于 Aerospike 冷启动时,在某些情况下可以进行热重启并且删除的数据不会重新出现。

关于python - 删除不适用于 aerospike 持久存储的记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35766232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com