Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/sessiontxn/isolation/readcommitted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/pingcap/failpoint"
"github.com/pingcap/kvproto/pkg/kvrpcpb"
"github.com/pingcap/tidb/pkg/config"
"github.com/pingcap/tidb/pkg/config/kerneltype"
"github.com/pingcap/tidb/pkg/executor"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/infoschema"
Expand Down Expand Up @@ -565,6 +566,12 @@ func initializePessimisticRCProvider(t testing.TB, tk *testkit.TestKit) *isolati
}

func TestFailedDMLConsistency1(t *testing.T) {
if kerneltype.IsNextGen() {
// NextGen hangs when acquiring pessimistic locks after failed DML with fair locking disabled
// root cause: cleanup not triggered properly for non-fair mode
// this 35682 might be related.
t.Skip("skip for next-gen kernel, as this test requires fair-locking")
}
store := testkit.CreateMockStore(t)

tk1 := testkit.NewTestKit(t, store)
Expand Down Expand Up @@ -595,6 +602,12 @@ func TestFailedDMLConsistency1(t *testing.T) {
}

func TestFailedDMLConsistency2(t *testing.T) {
if kerneltype.IsNextGen() {
// NextGen hangs when acquiring pessimistic locks after failed DML with fair locking disabled
// root cause: cleanup not triggered properly for non-fair mode.
// this 35682 might be related.
t.Skip("skip for next-gen kernel, as this test requires fair-locking")
}
store := testkit.CreateMockStore(t)
tk1 := testkit.NewTestKit(t, store)
tk1.MustExec("set @@tidb_txn_assertion_level=strict")
Expand Down
19 changes: 12 additions & 7 deletions pkg/telemetry/data_feature_usage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ func TestTxnUsageInfo(t *testing.T) {
txnUsage = telemetry.GetTxnUsageInfo(tk.Session())
require.True(t, txnUsage.RCWriteCheckTS)

tk.MustExec(fmt.Sprintf("set global %s = 0", vardef.TiDBPessimisticTransactionFairLocking))
txnUsage = telemetry.GetTxnUsageInfo(tk.Session())
require.False(t, txnUsage.FairLocking)

tk.MustExec(fmt.Sprintf("set global %s = 1", vardef.TiDBPessimisticTransactionFairLocking))
txnUsage = telemetry.GetTxnUsageInfo(tk.Session())
require.True(t, txnUsage.FairLocking)
if kerneltype.IsClassic() {
tk.MustExec(fmt.Sprintf("set global %s = 0", vardef.TiDBPessimisticTransactionFairLocking))
txnUsage = telemetry.GetTxnUsageInfo(tk.Session())
require.False(t, txnUsage.FairLocking)

tk.MustExec(fmt.Sprintf("set global %s = 1", vardef.TiDBPessimisticTransactionFairLocking))
txnUsage = telemetry.GetTxnUsageInfo(tk.Session())
require.True(t, txnUsage.FairLocking)
}
})

t.Run("Count", func(t *testing.T) {
Expand Down Expand Up @@ -855,6 +857,9 @@ func TestStoreBatchCopr(t *testing.T) {
}

func TestFairLockingUsage(t *testing.T) {
if kerneltype.IsNextGen() {
t.Skip("fair locking is not supported for next-gen yet")
}
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk2 := testkit.NewTestKit(t, store)
Expand Down