config: move resolve-lock-lite-threshold to tikv-client segment (#297)

This commit is contained in:
lysu 2021-09-02 14:23:07 +08:00 committed by GitHub
parent c7f8168472
commit 4fc565e203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 23 deletions

View File

@ -83,6 +83,7 @@ type TiKVClient struct {
CoprCache CoprocessorCache `toml:"copr-cache" json:"copr-cache"` CoprCache CoprocessorCache `toml:"copr-cache" json:"copr-cache"`
// TTLRefreshedTxnSize controls whether a transaction should update its TTL or not. // TTLRefreshedTxnSize controls whether a transaction should update its TTL or not.
TTLRefreshedTxnSize int64 `toml:"ttl-refreshed-txn-size" json:"ttl-refreshed-txn-size"` TTLRefreshedTxnSize int64 `toml:"ttl-refreshed-txn-size" json:"ttl-refreshed-txn-size"`
ResolveLockLiteThreshold uint64 `toml:"resolve-lock-lite-threshold" json:"resolve-lock-lite-threshold"`
} }
// AsyncCommit is the config for the async commit feature. The switch to enable it is a system variable. // AsyncCommit is the config for the async commit feature. The switch to enable it is a system variable.
@ -149,6 +150,8 @@ func DefaultTiKVClient() TiKVClient {
AdmissionMaxResultMB: 10, AdmissionMaxResultMB: 10,
AdmissionMinProcessMs: 5, AdmissionMinProcessMs: 5,
}, },
ResolveLockLiteThreshold: 16,
} }
} }

View File

@ -78,7 +78,6 @@ type Config struct {
TxnScope string TxnScope string
EnableAsyncCommit bool EnableAsyncCommit bool
Enable1PC bool Enable1PC bool
ResolveLockLiteThreshold uint64
} }
// DefaultConfig returns the default configuration. // DefaultConfig returns the default configuration.
@ -96,7 +95,6 @@ func DefaultConfig() Config {
TxnScope: "", TxnScope: "",
EnableAsyncCommit: false, EnableAsyncCommit: false,
Enable1PC: false, Enable1PC: false,
ResolveLockLiteThreshold: 16,
} }
} }

View File

@ -70,7 +70,7 @@ type LockResolver struct {
func NewLockResolver(store storage) *LockResolver { func NewLockResolver(store storage) *LockResolver {
r := &LockResolver{ r := &LockResolver{
store: store, store: store,
resolveLockLiteThreshold: config.GetGlobalConfig().ResolveLockLiteThreshold, resolveLockLiteThreshold: config.GetGlobalConfig().TiKVClient.ResolveLockLiteThreshold,
} }
r.mu.resolved = make(map[uint64]TxnStatus) r.mu.resolved = make(map[uint64]TxnStatus)
r.mu.recentResolved = list.New() r.mu.recentResolved = list.New()