Skip to content

Commit

Permalink
cherry pick #25470 to release-5.1
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
MyonKeminta authored and ti-srebot committed Jun 18, 2021
1 parent ead9937 commit f5ebaf2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ type Binlog struct {
// PessimisticTxn is the config for pessimistic transaction.
type PessimisticTxn struct {
// The max count of retry for a single statement in a pessimistic transaction.
MaxRetryCount uint `toml:"max-retry-count" json:"max-retry-count"`
MaxRetryCount uint `toml:"max-retry-count" json:"max-retry-count"`
// The max count of deadlock events that will be recorded in the information_schema.deadlocks table.
DeadlockHistoryCapacity uint `toml:"deadlock-history-capacity" json:"deadlock-history-capacity"`
}

Expand Down
3 changes: 3 additions & 0 deletions config/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ strategy = "range"
# max retry count for a statement in a pessimistic transaction.
max-retry-count = 256

# The max count of deadlock events that will be recorded in the information_schema.deadlocks table.
deadlock-history-capacity = 10

[stmt-summary]
# enable statement summary.
enable = true
Expand Down
3 changes: 3 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ group= "abc"
zone= "dc-1"
[security]
spilled-file-encryption-method = "plaintext"
[pessimistic-txn]
deadlock-history-capacity = 123
`)

c.Assert(err, IsNil)
Expand Down Expand Up @@ -284,6 +286,7 @@ spilled-file-encryption-method = "plaintext"
c.Assert(conf.EnableEnumLengthLimit, Equals, false)
c.Assert(conf.EnableForwarding, Equals, true)
c.Assert(conf.StoresRefreshInterval, Equals, uint64(30))
c.Assert(conf.PessimisticTxn.DeadlockHistoryCapacity, Equals, uint(123))

_, err = f.WriteString(`
[log.file]
Expand Down

0 comments on commit f5ebaf2

Please sign in to comment.