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

chore: remove transactional annotation #6492

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

guqing
Copy link
Member

@guqing guqing commented Aug 22, 2024

What type of PR is this?

/kind cleanup
/area core
/milestone 2.19.x

What this PR does / why we need it:

移除事务注解避免对索引创建产生影响,原因参考改动中的方法注释

其中一点特别注意:
在执行 client.create(name, data) 方法后,会尝试进行 indexer.indexRecord 操作。但 indexRecord 可能会因唯一索引中存在重复键而导致 indexRecord 失败,索引创建也会随之失败。为确保索引与数据的一致性,此时应回滚由 client.create(name, data) 对数据产生的影响,因此除非找到更佳的一致性问题解决方案,否则暂时不能移除此处的手动事务操作。

 return client.create(name, version, data)
                .map(updated -> converter.convertFrom(type, updated))
                .doOnNext(extension -> indexer.indexRecord(convertToRealExtension(extension)))
                .as(transactionalOperator::transactional);

将变更传递给 extension watcher 是在 doCreatedoUpdate 成功之后才会被处理,因此这里的事务回滚不会对 watcher 造成影响

Does this PR introduce a user-facing change?

None

@f2c-ci-robot f2c-ci-robot bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesn't merit a release note. labels Aug 22, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.19.x milestone Aug 22, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from JohnNiang and LIlGG August 22, 2024 04:47
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Aug 22, 2024
@guqing guqing force-pushed the chore/remove-transaction branch 2 times, most recently from 9cf7cd4 to 94c07de Compare August 22, 2024 06:37
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.23%. Comparing base (6cd8dc8) to head (383490f).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6492      +/-   ##
============================================
+ Coverage     58.18%   58.23%   +0.05%     
  Complexity     3774     3774              
============================================
  Files           651      651              
  Lines         22125    22125              
  Branches       1538     1538              
============================================
+ Hits          12873    12885      +12     
+ Misses         8641     8631      -10     
+ Partials        611      609       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@guqing guqing force-pushed the chore/remove-transaction branch 2 times, most recently from bf8cb39 to c9cc12e Compare August 22, 2024 07:27
Copy link

sonarcloud bot commented Aug 22, 2024

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2024
Copy link

f2c-ci-robot bot commented Aug 22, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 22, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit f9615d0 into halo-dev:main Aug 22, 2024
8 checks passed
@guqing guqing deleted the chore/remove-transaction branch August 22, 2024 08:40
@ruibaby ruibaby modified the milestones: 2.19.x, 2.19.0 Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants