Skip to content

Refactor kvstore#8073

Merged
ti-chi-bot[bot] merged 32 commits intopingcap:masterfrom
CalvinNeo:refactor-kvstore
Sep 12, 2023
Merged

Refactor kvstore#8073
ti-chi-bot[bot] merged 32 commits intopingcap:masterfrom
CalvinNeo:refactor-kvstore

Conversation

@CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Sep 8, 2023

What problem does this PR solve?

Issue Number: close #4646

Problem Summary:

The Transaction folder is renamed to KVStore, since it is originally a KVStore with a percolator executor to decode row data into column data built on raft kv.

The new KVStore folder will be made into a new kvstore library which will be linked to dbms.

The following files will be moved to TiDB:

  1. Collator
  2. TiDB row/column format. These codes are purely definitions of TiDB encoding, including Datum and RowCodec and TypeMapping. It does not relate to TiKV key's encoding.

The KVStore folder includes:

  1. Storages/KVStore/Decode is a bridge between KVStore and DeltaMerge. It is about:
    • How we read keys and values from KVStore.
    • How we use utils from TiDB and decode the value in row format kvs.
    • How we will transform row format into column format. It includes modules like RegionTable.
  2. Storages/KVStore/FFI is FFI utils and interfaces with TiFlash Proxy.
  3. Storages/KVStore/MultiRaft contains all modules that implements a raft kv. Including region, region manager, region range index.
  4. Storages/KVStore/Utils
  5. Storages/KVStore/TiKVHelpers contains some util functions about definitions in TiKV which can be extract as common util function, such as key format for percolator/keyspace, and pd client. The key format part is about how to parse TiKVKey, and uses some information in TiKVValue to perform percolator 2pc commit. Note some TiKV key utils are related to schema or range of tables, we will put them in Storages/KVStore/Decode.
  6. Storages/KVStore/Read contains all about learner read with strong consistency, inclduing mvcc and region lock info and read index. It does not include read from data KVStore and ingest into DeltaMerge, which is in Storages/KVStore/Decode.

The whole classification is not accurate, since we still rely on some decoded data such as DecodedTiKVKey in MultiRaft.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
a
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 8, 2023
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
CalvinNeo and others added 4 commits September 11, 2023 18:48
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@JaySon-Huang
Copy link
Contributor

/run-all-tests

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/run-all-tests

@CalvinNeo
Copy link
Member Author

/run-all-tests

@CalvinNeo
Copy link
Member Author

/run-all-tests

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@ti-chi-bot ti-chi-bot bot added the lgtm label Sep 12, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flowbehappy, JaySon-Huang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [JaySon-Huang,flowbehappy]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 12, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 12, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-11 09:50:34.466161417 +0000 UTC m=+262816.390717812: ☑️ agreed by JaySon-Huang.
  • 2023-09-12 09:35:51.035543838 +0000 UTC m=+348332.960100238: ☑️ agreed by flowbehappy.

@CalvinNeo
Copy link
Member Author

/hold wait for learner read pr

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 12, 2023
@CalvinNeo
Copy link
Member Author

/unhold no more wait

@CalvinNeo
Copy link
Member Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 12, 2023
@CalvinNeo
Copy link
Member Author

/run-all-tests

@CalvinNeo
Copy link
Member Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot merged commit d1a28a3 into pingcap:master Sep 12, 2023
@JaySon-Huang JaySon-Huang mentioned this pull request Sep 13, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breakdown the "dbms/src/Storages/Transaction" module

3 participants