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

定时刷新TableMeta缓存的功能失效了 #6660

Closed
1 task
wuwen5 opened this issue Jul 9, 2024 · 3 comments · Fixed by #6661
Closed
1 task

定时刷新TableMeta缓存的功能失效了 #6660

wuwen5 opened this issue Jul 9, 2024 · 3 comments · Fixed by #6661
Assignees
Labels
good first issue Good for newcomers type: bug Category issues or prs related to bug.

Comments

@wuwen5
Copy link
Contributor

wuwen5 commented Jul 9, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

定时刷新TableMeta缓存的功能失效了,程序每900秒后会由业务调用主动查询一次tableMeta导致慢请求
1.7.0 版本之后没有定时任务发起tableMetaRefreshEvent事件,导致tableMetaRefresh会一直处于tableMetaRefreshQueue.take()状态。

https://github.com/apache/incubator-seata/pull/4734/files 这次更新之后,原60秒刷新一次tablemeta缓存的功能失效了。

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Just paste your stack trace here!

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Minimal yet complete reproducer code (or URL to code):

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version(e.g. java -version):
  • Seata client/server version:
  • Database version:
  • OS(e.g. uname -a):
  • Others:
@funky-eyes
Copy link
Contributor

TableMetaCacheFactory#tableMetaRefreshEvent
And 119 lines, the refresh task will be initiated actively after the refresh time is reached

            tableMetaRefreshExecutor.execute(() -> {
                while (true) {
                    // 1. check table meta
                    if (ENABLE_TABLE_META_CHECKER_ENABLE
                        && System.currentTimeMillis() - lastRefreshFinishTime > TABLE_META_CHECKER_INTERVAL) {
                        tableMetaRefreshEvent(dataSource.getResourceId());
                    }

@funky-eyes
Copy link
Contributor

我明白你的意思了,由于这俩逻辑在同一个线程里,所以上面的刷新失效了
I see what you mean. Since these two logics are in the same thread, the above refresh is invalid.

@funky-eyes
Copy link
Contributor

你可以提交一个pr来修复这个bug吗?
Can you commit a PR to fix this bug?

@funky-eyes funky-eyes added good first issue Good for newcomers type: bug Category issues or prs related to bug. labels Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants