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

[close #776] Fix prewrite & commit log info to debug(#776) #777

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jackjeyis
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #issue_number

Problem Description: TBD

What is changed and how does it work?

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has methods of interface change
  • Has persistent data change
  • No code

Check List for Tests

This PR has been tested by at least one of the following methods:

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Possible performance regression, WHY: TBD
  • Increased code complexity, WHY: TBD
  • Breaking backward compatibility, WHY: TBD
  • NO side effects

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note
  • NO related changes

@@ -181,7 +180,6 @@ public ClientRPCResult commit(
// TODO: check this logic to see are we satisfied?
private boolean retryableException(Exception e) {
return e instanceof TiClientInternalException
|| e instanceof KeyException
Copy link
Collaborator

Choose a reason for hiding this comment

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

Delete this will be a break change. Some KeyException also need the retry, why do you want to exclude this?
If you still want to exclude some KeyException, please judge the type. here is an example

 if (e instanceof KeyException) {
      Kvrpcpb.KeyError ke = ((KeyException) e).getKeyError();
      if (ke == null) return true;
      if (!ke.getAbort().isEmpty()
          || ke.hasConflict()
          || ke.hasAlreadyExist()
          || ke.hasDeadlock()
          || ke.hasCommitTsExpired()
          || ke.hasTxnNotFound()) return false;
      return true;
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok,I review it again

@@ -76,4 +99,170 @@ public void autoClosableTest() throws Exception {
executorService)) {}
Assert.assertTrue(executorService.isShutdown());
}

@Test
public void prewriteWriteConflictFastFailTest() throws Exception {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems this test has nothing to do with this pr, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This test is based on the new constructor method added in this PR #775.
Do you mind move it to that PR, or the test will fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test for verify write conflict will aways retry ,but need fast fail

Copy link
Collaborator

Choose a reason for hiding this comment

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

could you explain why this test was added? Or what scenes/feature this test for

@shiyuhang0 shiyuhang0 changed the title fix prewrite & commit log info to debug(#776) [close #774]fix prewrite & commit log info to debug(#776) Jun 3, 2024
@shiyuhang0 shiyuhang0 changed the title [close #774]fix prewrite & commit log info to debug(#776) [close #774] Fix prewrite & commit log info to debug(#776) Jun 3, 2024
@shiyuhang0 shiyuhang0 changed the title [close #774] Fix prewrite & commit log info to debug(#776) [close #776 #778] Fix prewrite & commit log info to debug(#776) Jun 3, 2024
@shiyuhang0 shiyuhang0 changed the title [close #776 #778] Fix prewrite & commit log info to debug(#776) [close #776] Fix prewrite & commit log info to debug(#776) Jun 3, 2024
@@ -31,7 +31,7 @@ public KeyException(String errMsg) {
}

public KeyException(Kvrpcpb.KeyError keyErr) {
super("Key exception occurred");
super("Key exception occurred " + keyErr.toString());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need to print error msg here?
Have you tried getKeyErr()? it should return the error and you should be able to get the error msg from getKeyErr().toString()

@zhangyangyu
Copy link
Contributor

@jackjeyis thanks for your contribution. Is there any reason to change the log info? Does it cause any problem now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants