siddontang
Repos
161
Followers
2897

Events

delete branch
siddontang delete branch gh-readonly-queue/master/pr-1526-911ba088dfa57a517d98603f1cb69d80554de6d5
Created at 3 days ago
opened issue
need to remove any pingcap/tidb dependency in this repo

I found that client-go still uses TiDB mockstore and some codes for testing, like https://github.com/tikv/client-go/blob/master/integration_tests/util_test.go#L50

From my side, TiKV is the underlying component of TiDB, so it is very strange to let the TiKV client depend on TiDB's code, even in the test, and I also don't think we must rely on the TiDB's logic to test the TiKV client.

Another risk is that if we heavily use TiDB's mockstore, and client-go's origin mockstore may then lack maintenance. I tried to use client-go's own store instead of TiDB's mockstore below

@@ -83,7 +83,7 @@ type testLockSuite struct {
 }

 func (s *testLockSuite) SetupTest() {
-       s.store = tikv.StoreProbe{KVStore: NewTestUniStore(s.T())}
+       s.store = tikv.StoreProbe{KVStore: NewTestStore(s.T())}
 }

But failed with the following message:

   --- FAIL: TestLock/TestBatchResolveLocks (0.00s)
        lock_test.go:563:
            	Error Trace:	/Users/tangliu/eng/client-go/integration_tests/lock_test.go:563
            	Error:      	Expected nil, but got: not exist
            	Test:       	TestLock/TestBatchResolveLocks
        lock_test.go:564:
            	Error Trace:	/Users/tangliu/eng/client-go/integration_tests/lock_test.go:564
            	Error:      	Should be true
            	Test:       	TestLock/TestBatchResolveLocks
        lock_test.go:566:
            	Error Trace:	/Users/tangliu/eng/client-go/integration_tests/lock_test.go:566
            	Error:      	Expected nil, but got: not exist
            	Test:       	TestLock/TestBatchResolveLocks
        lock_test.go:567:
            	Error Trace:	/Users/tangliu/eng/client-go/integration_tests/lock_test.go:567
            	Error:      	Should be true
            	Test:       	TestLock/TestBatchResolveLocks

I didn't investigate deeply, but my guess is that the mockstore in client-go doesn't support lock TTL very well.

I know removing TiDB's dependency is a very hard work, but we need to consider it now. Let's follow some good engineering practices from now on.

Another thing is now we already have a mockstore in client-go, can we simplify the mockstore code in TiDB too (maybe let TiDB mostly use client-go's code). I still worry that later we may still focus on changing the code in TiDB instead of client-go, especially when we develop Transaction features.

/cc @zhangjinpeng1987 @kevin-xianliu

Created at 5 days ago
opened issue
why calculate keyspace ID every time in the request with V2 VPI

I found that now with V2 API, we will calculate the keyspace every time

func (c *codecV2) GetKeyspaceID() KeyspaceID {
	prefix := append([]byte{}, c.prefix...)
	prefix[0] = 0
	return KeyspaceID(binary.BigEndian.Uint32(prefix))
}

https://github.com/tikv/client-go/blob/master/internal/apicodec/codec_v2.go#L99

Why do we do this? seem that we can cache the value of KeyspaceID in the codecV2 structure directly.

@sunxiaoguang

Created at 1 week ago

update tidb version (#419)

Signed-off-by: lemonhx lemonhx@lemonhx.tech

Support setting assertions and receiving assertion errors for Prewrite requests (#311)

  • support set assertion in 2pc mutation

Signed-off-by: lysu sulifx@gmail.com Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Receive assertion fail errors from TiKV

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add test log

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Remove verbose log

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • update kvproto

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add metrics counter for assertions

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Address some comments

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Try to optimize assertion for pessimistic transactions

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Fix panic on optimistic transactions

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add InitCheckExistence method for LockCtx

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Support assertion level

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Check assertion level before doing assertion on client side

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Test bitoperations of menBUfferMutations.Push

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add test for assertion in tikv

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Support run assertion test with unistore

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Fix test

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Fix license

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Fix test

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • export DeleteKey

Signed-off-by: ekexium ekexium@gmail.com

  • Renaming DeleteKey

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • fix build

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Address comments

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Avoid panic when running with old version of TiKV; Add schema check on fast assertion

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add test for fast assertion

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add test for pessimistic lock check existence

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Test assertion takes no effect if amending is enabled

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add HasAssertUnknown function

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add comments

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Cleanup locks after assertion fail

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • update tidb dependency

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Fix panic in TestIllegalTSO

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Address comments

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Add comments

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Update dependency to tidb

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

  • Fix test

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

Co-authored-by: lysu sulifx@gmail.com Co-authored-by: MyonKeminta MyonKeminta@users.noreply.github.com Co-authored-by: ekexium ekexium@gmail.com

txnkv: add shortcut to get global timestamp (#395)

Signed-off-by: disksing i@disksing.com

*: update etcd client to v3.5.2 (#423)

Signed-off-by: disksing i@disksing.com

integration: update tidb to master branch (#426)

Signed-off-by: disksing i@disksing.com

region_cache: more comments and minor refactor (#427)

Signed-off-by: youjiali1995 zlwgx1023@gmail.com

txnkv: fix the issue that deleteRange cannot use nil as endkey (#429)

Signed-off-by: disksing i@disksing.com

*: update readme (#430)

Signed-off-by: disksing i@disksing.com

Add a columnFamily feature for client-go when use rawput in tikv (#425)

Signed-off-by: joccau zak.zhao@pingcap.com

integration: use less tidb code (#431)

Signed-off-by: disksing i@disksing.com

integration: replace some unistore with mockstore (#432)

Signed-off-by: disksing i@disksing.com

Fix incorrect LockNoWait value (#435)

Signed-off-by: Yilin Chen sticnarf@gmail.com

Add options parameters in API CompareAndSwap (#433)

Signed-off-by: joccau zak.zhao@pingcap.com

integration: try not to skip tests when run with tikv (#445)

Signed-off-by: disksing i@disksing.com

mockstore: fix assertion (#446)

Signed-off-by: disksing i@disksing.com

txn: support read-consistency read with tso checking (#447)

Signed-off-by: cfzjywxk lsswxrxr@163.com

region_cache: support buckets (#439)

Signed-off-by: youjiali1995 zlwgx1023@gmail.com

Update lock ttl when retry to pessimistic lock keys (#417)

Signed-off-by: longfangsong longfangsong@icloud.com

Return assertion failed error less prior to other kinds of errors (#448)

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

fix the comment of TimeDetail (#451)

Signed-off-by: ekexium ekexium@gmail.com

Created at 1 week ago
Created at 1 week ago
delete branch
siddontang delete branch gh-readonly-queue/master/pr-1513-96f8d98b5f208ebe0a17c3b3a3933cd506cb5fff
Created at 1 month ago
Created at 1 month ago