Skip to content

[ISSUE #4378] plugin rule update did not take effect in time.#4380

Merged
moremind merged 6 commits intoapache:masterfrom
iwangjie:issue_4378_dev
Feb 16, 2023
Merged

[ISSUE #4378] plugin rule update did not take effect in time.#4380
moremind merged 6 commits intoapache:masterfrom
iwangjie:issue_4378_dev

Conversation

@iwangjie
Copy link
Copy Markdown
Contributor

fix #4378

shenyu-admin update rule data. shenyu-bootstrap not effective.

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

@iwangjie iwangjie changed the title fix #4378 plugin rule update did not take effect in time. [ISSUE #4378] plugin rule update did not take effect in time. Feb 13, 2023
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 13, 2023

Codecov Report

Merging #4380 (6a34dd7) into master (962277f) will decrease coverage by 0.20%.
The diff coverage is 17.02%.

@@             Coverage Diff              @@
##             master    #4380      +/-   ##
============================================
- Coverage     68.36%   68.17%   -0.20%     
+ Complexity     7514     7507       -7     
============================================
  Files          1020     1020              
  Lines         28813    28838      +25     
  Branches       2568     2572       +4     
============================================
- Hits          19699    19660      -39     
- Misses         7579     7630      +51     
- Partials       1535     1548      +13     
Impacted Files Coverage Δ
...enyu/admin/service/publish/RuleEventPublisher.java 10.20% <0.00%> (-2.00%) ⬇️
.../apache/shenyu/common/enums/RuleTrieEventEnum.java 0.00% <0.00%> (ø)
...henyu/plugin/base/trie/ShenyuTrieRuleListener.java 0.00% <0.00%> (ø)
...in/java/org/apache/shenyu/common/dto/RuleData.java 74.44% <15.78%> (-11.27%) ⬇️
.../plugin/base/cache/CommonPluginDataSubscriber.java 72.38% <33.33%> (-1.66%) ⬇️
...a/org/apache/shenyu/admin/model/entity/RuleDO.java 79.46% <100.00%> (+0.37%) ⬆️
...che/shenyu/admin/service/impl/RuleServiceImpl.java 73.26% <100.00%> (+0.26%) ⬆️
...che/shenyu/sync/data/http/HttpSyncDataService.java 70.40% <0.00%> (-19.39%) ⬇️
...yu/sync/data/http/refresh/AbstractDataRefresh.java 68.96% <0.00%> (-13.80%) ⬇️
...he/shenyu/loadbalancer/spi/RandomLoadBalancer.java 81.81% <0.00%> (-9.10%) ⬇️
... and 14 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

final int ruleCount = ruleMapper.updateSelective(ruleDO);

// need old data for cleaning
final List<RuleConditionDO> beforeRuleCondition = ruleConditionMapper.selectByQuery(new RuleConditionQuery(ruleDO.getId()));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

update beforeRuleCondition ? why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

because the gateway uses the prefix tree to handle the cache, I can not clean up the history cache if Conditions change, so I pass the pre-modified Conditions to the past for precision cleaning.

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.

[BUG] Plugin rule update did not take effect in time.

5 participants