Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

performance: use OPTIMISTIC transaction as the default #1079

Merged
merged 28 commits into from
Sep 27, 2020

Conversation

GMHDBJD
Copy link
Collaborator

@GMHDBJD GMHDBJD commented Sep 23, 2020

What problem does this PR solve?

close #751

What is changed and how it works?

set default transaction mode to optimistic

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
    verify with different session cfg and run show variables

@GMHDBJD GMHDBJD added priority/normal Minor change, requires approval from ≥1 primary reviewer status/PTAL This PR is ready for review. Add this label back after committing new changes needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Sep 23, 2020
Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest LGTM

dm/config/task.go Outdated Show resolved Hide resolved
@lance6716
Copy link
Collaborator

LGTM

@ti-srebot ti-srebot added the status/LGT1 One reviewer already commented LGTM label Sep 23, 2020
Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

rest LGTM


// TargetDBConfig
defaultSessionCfg = map[string]string{
tidbTxnMode: tidbTxnOptimistic,
Copy link
Member

@csuzhangxc csuzhangxc Sep 24, 2020

Choose a reason for hiding this comment

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

Does a lower version of TiDB without optimistic TXN works well (or without interrupt)?

@GMHDBJD GMHDBJD added status/WIP This PR is still work in progress and removed status/LGT1 One reviewer already commented LGTM status/PTAL This PR is ready for review. Add this label back after committing new changes labels Sep 24, 2020
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Sep 25, 2020

/run-all-tests

This reverts commit 614def3.
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented Sep 25, 2020

/run-all-tests

@GMHDBJD GMHDBJD added status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/WIP This PR is still work in progress labels Sep 25, 2020
Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest LGTM

dm/master/server_test.go Show resolved Hide resolved
@lance6716
Copy link
Collaborator

LGTM

Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

rest LGTM

dm/config/task_test.go Outdated Show resolved Hide resolved
cfgs[i] = cfg
}
return cfgs, nil
}

func adjustTargetDB(ctx context.Context, dbConfig *config.DBConfig) error {
Copy link
Member

Choose a reason for hiding this comment

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

How about putting this function into task.go as a member of TaskConfig? we may need to use it in other places later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

circle import if move it to task.go because we import config in pkg.conn. 🤔

pkg/utils/db.go Outdated Show resolved Hide resolved
Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Sep 27, 2020
@csuzhangxc csuzhangxc added this to the v2.0.0 RC.3 milestone Sep 27, 2020
@GMHDBJD GMHDBJD merged commit 22621fc into pingcap:master Sep 27, 2020
@GMHDBJD GMHDBJD deleted the defautlOptimistic branch September 27, 2020 05:52
@ti-srebot
Copy link

cherry pick to release-2.0 in PR #1107

@ti-srebot ti-srebot added already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Sep 27, 2020
csuzhangxc pushed a commit that referenced this pull request Sep 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use OPTIMISTIC mode default
4 participants