Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic cleanup of the local data repo may accidentally delete snapshots #13203

Closed
88250 opened this issue Nov 19, 2024 · 19 comments
Closed

Automatic cleanup of the local data repo may accidentally delete snapshots #13203

88250 opened this issue Nov 19, 2024 · 19 comments
Assignees
Labels
Milestone

Comments

@88250
Copy link
Member

88250 commented Nov 19, 2024

#13091 的实现有 bug,会导致误删所有未引用的快照。

另外,加入一个改进:当天的所有快照不纳入清理。

@tcmtom
Copy link

tcmtom commented Nov 20, 2024

https://ld246.com/article/1732032433344
这个公告里面还是写着“每天仅保留 2 个快照”

@88250
Copy link
Member Author

88250 commented Nov 20, 2024 via email

@zxhd863943427
Copy link
Contributor

目前是否有开关和默认关闭?

@88250
Copy link
Member Author

88250 commented Nov 20, 2024

默认开启,没有开关,因为自动清理是设计预期,如果想要达到不清理的目的,可以将配置值设置大一些。

@zxhd863943427
Copy link
Contributor

那么升级时自动删除了180天以前的快照怎么处理?这时无法配置

@88250
Copy link
Member Author

88250 commented Nov 20, 2024 via email

@TCOTC
Copy link
Contributor

TCOTC commented Nov 20, 2024

打开的时候不是会自动同步的吗?

@88250
Copy link
Member Author

88250 commented Nov 20, 2024 via email

@zxhd863943427
Copy link
Contributor

那自动同步和退出同步呢?

@zxhd863943427
Copy link
Contributor

另外,无论怎么说,我不认为这种删除用户数据、哪怕可能是冗余数据的功能,是可以默认自动执行的且没有开关的。

而且默认配置选项远低于大部分用户现存的快照期限。

@88250
Copy link
Member Author

88250 commented Nov 20, 2024

自动同步会触发,退出同步不触发,所以说可以一进入以后就去改设置。

默认配置 180 天已经足够了吧,实际上一部分用户也有定期手动清空数据仓库的使用习惯。

@zxhd863943427
Copy link
Contributor

那另一部分呢?我就是一个比较注重快照保存的用户。不能无视这部分用户的需求吧。

这个设计搞得对我来说就是一种要是不看具体更新详情,然后过个一天我的数据就丢失了的感觉。

@88250
Copy link
Member Author

88250 commented Nov 20, 2024

没有无视需求的,数据安全肯定是第一位,但是对于历史数据只能有选择的保存,这也是性能和安全性之间的权衡。

历史数据的保存期限不可能是永久啊,所以尽量长一点(180 天)已经能够应对大部分灾难恢复场景了。

EightDoor added a commit to EightDoor/siyuan that referenced this issue Nov 22, 2024
* commit '928c1d476a4b398bdee3752cc950aed85838bf8f': (148 commits)
  🔖 Release v3.1.13
  🐛 Automatic cleanup of the local data repo may accidentally delete snapshots siyuan-note#13203
  🎨 Add internal kernel API `/api/sqlite/flushTransaction` siyuan-note#10005
  🐛 Automatic cleanup of the local data repo may accidentally delete snapshots siyuan-note#13203
  🎨 删除块,嵌入块中没有同步删除
  💄
  🔖 Release v3.1.12
  ⬆️ eslint
  🎨 Improve graph rendering siyuan-note#13196
  🎨 siyuan-note#13143
  🎨 siyuan-note#13190
  📝 Update changelogs
  ⬆️
  🎨 Improve av option editing siyuan-note#11484
  🎨 siyuan-note#13164
  🎨 Support HarmonyOS NEXT system siyuan-note#13184
  🎨 siyuan-note#11053
  🚨
  🎨 siyuan-note#11053
  🎨 Support HarmonyOS NEXT system siyuan-note#13184
  ...
@zxhd863943427
Copy link
Contributor

https://ld246.com/article/1732094960883

目前调查结果来说三分之一的人需要一个开关,这个不能说是我的个例需求了吧……

另外更大多数的人需要范围设置。

@88250
Copy link
Member Author

88250 commented Nov 23, 2024

这两个配置暂时不考虑了,目前已经默认保留当天所有快照。

@zxhd863943427
Copy link
Contributor

这个跟当天快照没关系啊……当天快照解决不了帖子里提出的任何一个问题。

@zxhd863943427
Copy link
Contributor

zxhd863943427 commented Nov 23, 2024

三成用户的强烈需求不算少了,目前的实现对这些用户体验的损失是不可逆转的。毕竟快照都在并不知情的情况下自动删了。

@88250
Copy link
Member Author

88250 commented Nov 23, 2024 via email

@zxhd863943427
Copy link
Contributor

那我只能说很失望,并对这些用户的数据丢失表示很遗憾,我已经尽力了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants