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

Improve data sync to reduce the probability of conflicts #13065

Closed
Jiangshuon opened this issue Nov 6, 2024 · 3 comments
Closed

Improve data sync to reduce the probability of conflicts #13065

Jiangshuon opened this issue Nov 6, 2024 · 3 comments
Assignees

Comments

@Jiangshuon
Copy link

Jiangshuon commented Nov 6, 2024

没有同时编辑的情况下发生同步冲突

In what scenarios do you need this feature?

均是在用电脑,手机是挂在后台没有编辑操作的

第一次:Conflicted 2024-11-05 21:09:24

连续改了几个数据库的标题,每个数据库都有很多块

第二次:Conflicted 2024-11-06 21:22:52

普通编辑

Describe the optimal solution

电脑日志:

system-log (5).zip

移动端日志:
system-log-3.zip

Describe the candidate solution

No response

Other information

No response

@88250
Copy link
Member

88250 commented Nov 7, 2024

第一次冲突是因为 Android 端同步后计算出了新增文档,所以需要创建一个合并快照,然后继续推送 PC 端,而 PC 端也正在编辑这个文档,所以产生冲突:

/20230119231527-harn4t7/20230120000714-soczjxh/20241105210042-11cof2n.sy

请帮忙确认一下是不是这个文档冲突的。

第二次冲突是因为有个插件配置文件在 Android 端发生了变动:

I 2024/11/06 21:22:41 sync.go:240: cloud upsert [660f632063a2a097261ed14b3c41bc8294360355, /storage/petal/syplugin-document-search/search-setting.json, 2024-11-06 20:59:11]
I 2024/11/06 21:22:41 sync.go:246: local upsert [da6182dfd9bca03f877e67b58e299065e339cc67, /storage/petal/syplugin-document-search/search-setting.json, 2024-11-06 21:22:38]

以 Android 端 local 为准以后推送 PC 端,PC 端走的是下载快照,所以就和当前编辑冲突了。

麻烦帮忙确认一下第一点是不是这个文档冲突的。

@88250 88250 self-assigned this Nov 7, 2024
@Jiangshuon
Copy link
Author

应该不是的,这个文档没有冲突,冲突的是数据库中引用块所在的多个文档,不是数据库所在的文档,我一次性冲突了几十个文档

好像修改数据库标题后,会马上更新引用块右上角的数据库标题名,这相当于在编辑该文档

是不是这个原因容易引起冲突呢,如果数据库中块很多很多,这个过程中就相当于在不停地修改不同的文档,就容易引起冲突了

是不是块的数据库标题在修改后打开这个文档后才更新比较好呢,而不是立马就更新

我记得之前有个issue就是改成立马更新的,最开始是懒更新的

@88250
Copy link
Member

88250 commented Nov 8, 2024

哦,对,应该是修改数据库角标属性导致的,这种情况如果当前设备也改了这个文档就冲突了(可能正在自动修改属性)。

后面我看下能不将同步置后,即需要等待这些自动修改完毕后才执行同步。

@88250 88250 added this to the 3.1.12 milestone Nov 9, 2024
@88250 88250 changed the title 没有同时编辑的情况下发生同步冲突 Improve data synchronization to reduce the probability of conflicts Nov 9, 2024
@88250 88250 closed this as completed Nov 9, 2024
@88250 88250 changed the title Improve data synchronization to reduce the probability of conflicts Improve data sync to reduce the probability of conflicts Nov 9, 2024
@88250 88250 removed this from the 3.1.12 milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants