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

feat: project-manager itsm-migrate 幂等优化 #3613

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

yuyudeqiu
Copy link
Contributor

当bcs进行重装时,可能会由于mongodb的重装导致原本的数据丢失,但是itsm服务上依旧保留了相关的service,再重装时执行itsm-migrate的job时就可能会出错,因为重复导入的service;同时也需要考虑另外一种情况,当itsm进行重装或者是数据初始化,导致数据丢失,造成两边数据不一致的问题。修改思路如下:

  1. 首先查询itsm,如果可以查到相关的service,则拿到serviceID进行更新
  2. 没查到则tism上无相关service,进行导入
  3. 最后通过serviceID,更新mongodb。无论是导入或者更新都对mongodb进行更新保证数据一致

@AlkaidChan AlkaidChan merged commit 5e88314 into TencentBlueKing:master Nov 27, 2024
11 of 14 checks passed
@yuyudeqiu yuyudeqiu deleted the fix_itsm_migrate branch November 27, 2024 03:12
@yuyudeqiu yuyudeqiu restored the fix_itsm_migrate branch November 27, 2024 05:35
evanlixin added a commit that referenced this pull request Nov 27, 2024
* github-bk-bcs/master:
  feat: project-manager itsm migrate 幂等 (#3613)
  feat: bcs-project-manager增加命令行参数控制是否迁移cc数据 (#3607)
  feat: optimizing delay tasks (#3611)
@yuyudeqiu yuyudeqiu deleted the fix_itsm_migrate branch November 28, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants