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

@ -82,7 +82,8 @@ type TiKVClient struct {
StoreLivenessTimeout string `toml:"store-liveness-timeout" json:"store-liveness-timeout"`
CoprCache CoprocessorCache `toml:"copr-cache" json:"copr-cache"`
// 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.
@ -149,6 +150,8 @@ func DefaultTiKVClient() TiKVClient {
AdmissionMaxResultMB: 10,
AdmissionMinProcessMs: 5,
},
ResolveLockLiteThreshold: 16,
}
}

View File

@ -71,32 +71,30 @@ type Config struct {
PessimisticTxn PessimisticTxn
TxnLocalLatches TxnLocalLatches
// StoresRefreshInterval indicates the interval of refreshing stores info, the unit is second.
StoresRefreshInterval uint64
OpenTracingEnable bool
Path string
EnableForwarding bool
TxnScope string
EnableAsyncCommit bool
Enable1PC bool
ResolveLockLiteThreshold uint64
StoresRefreshInterval uint64
OpenTracingEnable bool
Path string
EnableForwarding bool
TxnScope string
EnableAsyncCommit bool
Enable1PC bool
}
// DefaultConfig returns the default configuration.
func DefaultConfig() Config {
return Config{
CommitterConcurrency: 128,
MaxTxnTTL: 60 * 60 * 1000, // 1hour
TiKVClient: DefaultTiKVClient(),
PDClient: DefaultPDClient(),
TxnLocalLatches: DefaultTxnLocalLatches(),
StoresRefreshInterval: DefStoresRefreshInterval,
OpenTracingEnable: false,
Path: "",
EnableForwarding: false,
TxnScope: "",
EnableAsyncCommit: false,
Enable1PC: false,
ResolveLockLiteThreshold: 16,
CommitterConcurrency: 128,
MaxTxnTTL: 60 * 60 * 1000, // 1hour
TiKVClient: DefaultTiKVClient(),
PDClient: DefaultPDClient(),
TxnLocalLatches: DefaultTxnLocalLatches(),
StoresRefreshInterval: DefStoresRefreshInterval,
OpenTracingEnable: false,
Path: "",
EnableForwarding: false,
TxnScope: "",
EnableAsyncCommit: false,
Enable1PC: false,
}
}

View File

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