-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
fix: unique index conflict issue after backup restoration preventing startup #6701
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6701 +/- ##
============================================
- Coverage 58.29% 57.81% -0.48%
- Complexity 3963 3993 +30
============================================
Files 680 706 +26
Lines 23338 23779 +441
Branches 1584 1572 -12
============================================
+ Hits 13604 13747 +143
- Misses 9108 9410 +302
+ Partials 626 622 -4 ☔ View full report in Codecov by Sentry. |
Hi @guqing ,因为之前的默认行为是合并数据,当前 PR 将会修改默认行为。所以我有以下几点建议:
|
要检查冲突时跳过那就不能使用 ExtensionStoreRepository 来 save 了,而且 merge 和 skipDuplicates 应该会有重叠 |
我的建议:提供一个参数(例如 prune=true)用于表示是否需要在恢复前清除已经存在的所有数据(包括数据库中的数据和工作目录的文件)。不过默认情况下不清除。 另外,需要在 Console 侧给出足够的提示 @halo-dev/sig-halo-console 。 |
即使添加了 prune 参数,也解决不了问题,因为不通过 prune=true 恢复后发生冲突也只能删除了重新初始化才行,而不能通过 prune 再次重试,可能得在恢复界面加一段说明来告知用户 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@halo-dev/api-client
@halo-dev/components
@halo-dev/richtext-editor
@halo-dev/console-shared
@halo-dev/ui-plugin-bundler-kit
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
/area core
/milestone 2.20.x
/sig docs
What this PR does / why we need it:
修复恢复备份后可能会因为与之前的数据冲突导致无法启动的问题
如果恢复时发生不可预知的错误,需要重启之后重新初始化再进行恢复
Which issue(s) this PR fixes:
Fixes #6672
Does this PR introduce a user-facing change?