-
Notifications
You must be signed in to change notification settings - Fork 5.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
store/tikv: Make maxTxnTimeUse a configurable value #8215
store/tikv: Make maxTxnTimeUse a configurable value #8215
Conversation
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
LGTM |
store/tikv/2pc.go
Outdated
@@ -15,6 +15,7 @@ package tikv | |||
|
|||
import ( | |||
"bytes" | |||
"github.com/pingcap/tidb/config" |
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.
put this package into the package block of the third-part packages
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
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
/run-all-tests |
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.
If we set it in the config file, e.g. 1 hour, when the gc life time change to 10 min. What will happen?
I think we'd better save the gc life time in pd like ddl schema version.
PTAL @tiancaiamao |
@jackysp In this PR it's user's responsibility to ensure maxTxnTime is less than gc_life_time. There may be a better solution, but it will take some time to get it done. |
CI failed.. I'm not sure if that's caused by my chagnes |
/run-integration-ddl-test |
@tiancaiamao PTAL |
May this PR merge? @jackysp |
Hold on. PTAL @tiancaiamao . |
LGTM |
Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com
What problem does this PR solve?
Sometimes in an olap senario, an
insert into select
statement may take too long time to finish. Then themaxTxnTimeUse
(590 seconds) may easily be exceeded. It's better to make it configurable.The
maxTxnTimeUse
is required because we don't want the transaction be broken by GC. That's why we recommend users not to set the gc_life_time less than 10m. However we didn't really check if the gc_life_time was set too short. In this PR, I still didn't check it.What is changed and how it works?
This PR adds a field
max-txn-time-use
to the config file, tikv-client` section. Then in 2pc.go use the config value instead of a constant.Check List
Tests
Code changes
Side effects
Related changes