-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
bugfix : check if table meta cache should be refreshed in AT mode #4734
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## develop #4734 +/- ##
=============================================
- Coverage 48.63% 48.57% -0.07%
+ Complexity 4184 4180 -4
=============================================
Files 743 744 +1
Lines 26646 26688 +42
Branches 3328 3332 +4
=============================================
+ Hits 12960 12963 +3
- Misses 12296 12326 +30
- Partials 1390 1399 +9
|
rm-datasource/src/main/java/io/seata/rm/datasource/sql/struct/TableRecords.java
Outdated
Show resolved
Hide resolved
|
rm-datasource/src/main/java/io/seata/rm/datasource/exception/RmTableMetaException.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/sql/struct/cache/AbstractTableMetaCache.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/sql/struct/cache/AbstractTableMetaCache.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/DataSourceProxy.java
Outdated
Show resolved
Hide resolved
…v_4572_new_feild_null
…v_4572_new_feild_null
TableMetaRefreshHolder(DataSourceProxy dataSource) { | ||
this.dataSource = dataSource; | ||
this.lastRefreshFinishTime = System.currentTimeMillis() - TABLE_META_REFRESH_INTERVAL_TIME; | ||
this.tableMetaRefreshQueue = new LinkedBlockingQueue<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
limited the queue length
@@ -55,6 +59,8 @@ public class TableRecords implements java.io.Serializable { | |||
|
|||
private List<Row> rows = new ArrayList<Row>(); | |||
|
|||
private static final Interner<String> TABLE_NAME_POOL = Interners.newWeakInterner(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ache#4734) (cherry picked from commit 28b3413)
@@ -120,20 +98,18 @@ private void init(DataSource dataSource, String resourceGroupId) { | |||
} | |||
initResourceId(); | |||
DefaultResourceManager.get().registerResource(this); | |||
if (ENABLE_TABLE_META_CHECKER_ENABLE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原定时刷新缓存的功能在这次更新后失效了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tableMeta缓存刷新失效? #6660
Ⅰ. Describe what this PR did
AT模式下,在构造record的时候会遍历resultset并从tablemeta里获取表结构。如果数据库表中新建了一个字段,就会报空指针。
at io.seata.rm.datasource.sql.struct.TableRecords.buildRecords(TableRecords.java:195)
旧方案(已废弃):
新方案(已实现):
关于单测:在TableRecordsTest模拟了字段不同的情况
Ⅱ. Does this pull request fix one issue?
fixes #4572
fixes #5292
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews