You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "MinatoWu (via GitHub)" <gi...@apache.org> on 2025/07/08 08:28:27 UTC

[PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

MinatoWu opened a new pull request, #857:
URL: https://github.com/apache/incubator-seata-go/pull/857

   <!--  Thanks for sending a pull request! 
   -->
   
   **What this PR does**:
   Fixed storing capital table names in cache when obtaining metadata and refreshing, adding tablemeta field capital table name field, and handling inconsistent table names when modifying construction lock keys
   about :https://github.com/apache/incubator-seata-go/pull/781
   **Which issue(s) this PR fixes**:
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
   -->
   Fixes #846 
   
   **Special notes for your reviewer**:
   
   **Does this PR introduce a user-facing change?**:
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
   -->
   ```release-note
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

Posted by "Code-Fight (via GitHub)" <gi...@apache.org>.
Code-Fight commented on code in PR #857:
URL: https://github.com/apache/incubator-seata-go/pull/857#discussion_r2217273036


##########
pkg/datasource/sql/datasource/base/meta_cache_test.go:
##########
@@ -229,11 +233,11 @@ func TestBaseTableMetaCache_GetTableMeta(t *testing.T) {
 			cache := &BaseTableMetaCache{
 				trigger: mockTrigger,
 				cache: map[string]*entry{
-					"T_USER": {
+					"t_user2": {

Review Comment:
   We also need some tests with lowercase only.



##########
pkg/datasource/sql/util/lockkey.go:
##########
@@ -34,7 +34,7 @@ func BuildLockKey(records *types.RecordImage, meta types.TableMeta) string {
 		colIndex int
 	}
 
-	lockKeys.WriteString(meta.TableName)
+	lockKeys.WriteString(meta.UpperTableName)

Review Comment:
   I think, do we really need a separate UpperTableName field? Would it be sufficient to just convert the table name to uppercase during the construction of the lock key and then use it directly?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #857:
URL: https://github.com/apache/incubator-seata-go/pull/857#issuecomment-3047898374

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `66.66667%` with `4 lines` in your changes missing coverage. Please review.
   > Project coverage is 38.03%. Comparing base [(`d30ffd6`)](https://app.codecov.io/gh/apache/incubator-seata-go/commit/d30ffd6f3d5230d9cada7dca40381789a783a527?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`cb40e98`)](https://app.codecov.io/gh/apache/incubator-seata-go/commit/cb40e9873692bb3e6e5ea06dae775908bd4097af?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [pkg/datasource/sql/datasource/base/meta\_cache.go](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?src=pr&el=tree&filepath=pkg%2Fdatasource%2Fsql%2Fdatasource%2Fbase%2Fmeta_cache.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2RhdGFzb3VyY2Uvc3FsL2RhdGFzb3VyY2UvYmFzZS9tZXRhX2NhY2hlLmdv) | 66.66% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...asource/sql/undo/builder/basic\_undo\_log\_builder.go](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?src=pr&el=tree&filepath=pkg%2Fdatasource%2Fsql%2Fundo%2Fbuilder%2Fbasic_undo_log_builder.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2RhdGFzb3VyY2Uvc3FsL3VuZG8vYnVpbGRlci9iYXNpY191bmRvX2xvZ19idWlsZGVyLmdv) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [pkg/datasource/sql/util/lockkey.go](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?src=pr&el=tree&filepath=pkg%2Fdatasource%2Fsql%2Futil%2Flockkey.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL2RhdGFzb3VyY2Uvc3FsL3V0aWwvbG9ja2tleS5nbw==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #857      +/-   ##
   ==========================================
   - Coverage   38.09%   38.03%   -0.07%     
   ==========================================
     Files         186      186              
     Lines       11234    11233       -1     
   ==========================================
   - Hits         4280     4272       -8     
   - Misses       6530     6537       +7     
     Partials      424      424              
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-seata-go/pull/857?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

Posted by "MinatoWu (via GitHub)" <gi...@apache.org>.
MinatoWu commented on code in PR #857:
URL: https://github.com/apache/incubator-seata-go/pull/857#discussion_r2217298466


##########
pkg/datasource/sql/datasource/base/meta_cache_test.go:
##########
@@ -229,11 +233,11 @@ func TestBaseTableMetaCache_GetTableMeta(t *testing.T) {
 			cache := &BaseTableMetaCache{
 				trigger: mockTrigger,
 				cache: map[string]*entry{
-					"T_USER": {
+					"t_user2": {

Review Comment:
   Do you need to add lower-case cases?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

Posted by "MinatoWu (via GitHub)" <gi...@apache.org>.
MinatoWu commented on code in PR #857:
URL: https://github.com/apache/incubator-seata-go/pull/857#discussion_r2217536286


##########
pkg/datasource/sql/datasource/base/meta_cache_test.go:
##########
@@ -229,11 +233,11 @@ func TestBaseTableMetaCache_GetTableMeta(t *testing.T) {
 			cache := &BaseTableMetaCache{
 				trigger: mockTrigger,
 				cache: map[string]*entry{
-					"T_USER": {
+					"t_user2": {

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

Posted by "MinatoWu (via GitHub)" <gi...@apache.org>.
MinatoWu commented on code in PR #857:
URL: https://github.com/apache/incubator-seata-go/pull/857#discussion_r2217294450


##########
pkg/datasource/sql/util/lockkey.go:
##########
@@ -34,7 +34,7 @@ func BuildLockKey(records *types.RecordImage, meta types.TableMeta) string {
 		colIndex int
 	}
 
-	lockKeys.WriteString(meta.TableName)
+	lockKeys.WriteString(meta.UpperTableName)

Review Comment:
   Got it. I'll simplify it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

Posted by "Code-Fight (via GitHub)" <gi...@apache.org>.
Code-Fight merged PR #857:
URL: https://github.com/apache/incubator-seata-go/pull/857


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] Fix : del metadatacache uppertablenamekey and increase tablemeta field uppertablename [incubator-seata-go]

Posted by "MinatoWu (via GitHub)" <gi...@apache.org>.
MinatoWu commented on code in PR #857:
URL: https://github.com/apache/incubator-seata-go/pull/857#discussion_r2217298466


##########
pkg/datasource/sql/datasource/base/meta_cache_test.go:
##########
@@ -229,11 +233,11 @@ func TestBaseTableMetaCache_GetTableMeta(t *testing.T) {
 			cache := &BaseTableMetaCache{
 				trigger: mockTrigger,
 				cache: map[string]*entry{
-					"T_USER": {
+					"t_user2": {

Review Comment:
   Do you need to add lower-case cases?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org