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

Event cork #361

Merged
merged 3 commits into from
Nov 28, 2022
Merged

Event cork #361

merged 3 commits into from
Nov 28, 2022

Conversation

elrrrrrrr
Copy link
Member

@elrrrrrrr elrrrrrrr commented Nov 27, 2022

syncPackage 同步时,由于任务并发,可能会导致同步过程中 versions 表记录已经创建,pkg.manifests 还没有同步
针对这种场景做补偿逻辑,防止 tag 打在一个 pkg.manifests 没有的版本里

  • 修改 pkg.manifests 补偿逻辑,兼容有 versions 没 pkg.manifests 的情况
  • 添加 eventCork 的 advice,在 syncPackage 任务结束后,再统一触发 changes,依赖 ref

在同步和被同步的场景,确保 changes 发出时,pkg.manifests 已经更新
统一 ctx 内不同 changes 时序可能影响,不影响重新读取 manifests 一致性

@codecov
Copy link

codecov bot commented Nov 27, 2022

Codecov Report

Merging #361 (1ae2ecc) into main (c1eb097) will increase coverage by 0.11%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #361      +/-   ##
==========================================
+ Coverage   95.74%   95.85%   +0.11%     
==========================================
  Files         148      149       +1     
  Lines        4513     4514       +1     
  Branches      390      390              
==========================================
+ Hits         4321     4327       +6     
+ Misses        192      187       -5     
Impacted Files Coverage Δ
app/core/service/EventCorkerAdvice.ts 100.00% <100.00%> (ø)
app/core/service/PackageSyncerService.ts 98.95% <100.00%> (+1.26%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@elrrrrrrr elrrrrrrr changed the title Event cork WIP: Event cork Nov 28, 2022
@elrrrrrrr elrrrrrrr changed the title WIP: Event cork Event cork Nov 28, 2022
Copy link
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他没问题了。

@fengmk2 fengmk2 added the enhancement New feature or request label Nov 28, 2022
@fengmk2
Copy link
Member

fengmk2 commented Nov 28, 2022

2.8.0

fengmk2 pushed a commit that referenced this pull request Feb 14, 2023
> 相同任务并发执行时,如果上游有 changesStream 事件,可能会导致版本被错误删除。
* 撤销 #352 的变更,我们已在
#361 中解决了事件实时性问题

------------

> Concurrent execution of the same task with changesStream events may
cause versions to be deleted incorrectly.
* revert #352, since we have fixed
in #361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants