-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove transactional annotation (#6492)
#### 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)` 对数据产生的影响,因此除非找到更佳的一致性问题解决方案,否则暂时不能移除此处的手动事务操作。 ```java return client.create(name, version, data) .map(updated -> converter.convertFrom(type, updated)) .doOnNext(extension -> indexer.indexRecord(convertToRealExtension(extension))) .as(transactionalOperator::transactional); ``` 将变更传递给 extension watcher 是在 `doCreate` 或 `doUpdate` 成功之后才会被处理,因此这里的事务回滚不会对 watcher 造成影响 #### Does this PR introduce a user-facing change? ```release-note None ```
- Loading branch information
Showing
4 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters