Skip to content

Commit

Permalink
txn-file: Change switch variable to DisableTxnFile (tikv#1485)
Browse files Browse the repository at this point in the history
 

Signed-off-by: Ping Yu <[email protected]>
  • Loading branch information
pingyu authored Nov 6, 2024
1 parent 53f61c5 commit e9df112
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions kv/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ type Variables struct {
// When its value is not 0, it's killed, the value indicates concrete reason.
Killed *uint32

// EnableTxnFile specifies whether file-based txn is enabled.
EnableTxnFile bool
// DisableTxnFile specifies whether file-based txn is disabled.
DisableTxnFile bool
}

// NewVariables create a new Variables instance with default values.
Expand All @@ -60,7 +60,7 @@ func NewVariables(killed *uint32) *Variables {
BackoffLockFast: DefBackoffLockFast,
BackOffWeight: DefBackOffWeight,
Killed: killed,
EnableTxnFile: false,
DisableTxnFile: false,
}
}

Expand Down
2 changes: 1 addition & 1 deletion txnkv/transaction/txn_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ func (c *twoPhaseCommitter) getKeyspaceID() apicodec.KeyspaceID {
}

func (c *twoPhaseCommitter) useTxnFile(ctx context.Context) (bool, error) {
if c.txn == nil || !c.txn.vars.EnableTxnFile {
if c.txn == nil || c.txn.vars.DisableTxnFile {
return false, nil
}
conf := config.GetGlobalConfig()
Expand Down

0 comments on commit e9df112

Please sign in to comment.