Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Quest #25

Open
1 of 32 tasks
nrc opened this issue Jun 25, 2020 · 4 comments
Open
1 of 32 tasks

Documentation Quest #25

nrc opened this issue Jun 25, 2020 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@nrc
Copy link
Collaborator

nrc commented Jun 25, 2020

TiKV needs better documentation. The transaction SIG will do its part by documenting the concepts and code behind the TiKV/TiDB transaction system.

If the quest is successful, it should be easier for

  • users to understand the isolation properties and performance characteristics of TiKV/TiDB
  • users to reason about how to configure their transaction usage
  • new contributors to understand TiKV transactions and write code to change their implementation
  • outsiders to survey and understand TiKV's transaction implementation, and compare it to other databases

See the leader board for a ranking of documentation questers.

Mentors

If you want advice, help, or review, the following people are available and will prioritize quest issues:

Resources

Existing documentation and other resources are listed in the doc directory.

Tasks

To claim a task:

  • file an issue for it (either in this repository or TiKV
  • include a reference to this issue, and ask a mentor (listed above) to add the issue link here
  • a mentor will be assigned to that issue and they will keep this issue up to date with the task's status
  • let the mentor know if you need help or if someone else should take on the task

Tasks may or may not have a related issue. Tasks with names are being worked on by that user and should have an open issue for discussion. Boxes get ticked when the documentation task is complete.

High level documentation

Describe the underlying concepts of transactions (mostly be linking to other material, but we should organize and document that material and ensure it covers everything, filling in gaps where necessary). Describe at an algorithmic level the way transactions are implemented in TiKV.

  • Transactions overview, data format, latches, MVCC (TiDB docs, TinyKV docs, Xuelian's blog, VLDB paper)
  • Optimistic locking
  • Pessimistic locking (blog post)
  • Isolation/consistency properties (Jepsen report)
  • Lock management/waiter mangement, deadlock detection
  • GC, green GC
  • Pipelined pessimistic locking
  • Large transactions (blog post)
  • Parallel commit (repo)
  • 1pc
  • Replica read (aka follower read)
  • Timestamps and HLC
  • Alternative implementations

Module documentation

Describe modules of the TiKV implementation. This should how the code works, why that design was chosen, and how it fits in with the larger transaction system. We should have documentation per-concept, which should be roughly a Rust module, but is unlikely to exactly match.

MongoDB has lots of great examples of module-level docs, e.g., storage.

Code comments

Not every type and function needs a comment, but it would be great to document the more important and more complex code.

TiKV:

Rust Client:

TiDB:

TODO more tasks

@nrc nrc added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Jun 25, 2020
This was referenced Jun 25, 2020
@nrc
Copy link
Collaborator Author

nrc commented Jun 25, 2020

Leader board

User Tasks complete
@nrc 0

@pramodbiligiri
Copy link
Contributor

Noting down my thoughts on what the existing TiDB docs look like. I'm keeping in mind two types of users (Users and Developers) and the kind of documentation they'll need:

  1. Users → User Guide: a step by step guide on how to use TiKV Transactions.
  2. Developers → Design docs, Module level and code level docs.
  3. Both Users and Developers → TiDB Transactions Reference, which is exhaustive but may not have detailed explanations.

Existing TiDB docs look like this:

Target audience Type of docs Current location
Users User Guide docs.pingcap.com -> Reference -> SQL -> Transactions
Users, Developers Reference docs.pingcap.com -> Reference -> SQL -> Transactions
Developers Developer docs sig-transaction
Existing and prospective customers Blog posts https://pingcap.com/blog/pessimistic-locking-better-mysql-compatibility-fewer-rollbacks-under-high-load and https://pingcap.com/blog/large-transactions-in-tidb

Blog posts are good to announce new features in a timely manner, but they are hard to discover when reading other official documentation. So any information in blogs should also be available in one of the other sources. Ideally, blog posts should contain links to more official documentation but never the other way round.

@pramodbiligiri
Copy link
Contributor

pramodbiligiri commented Nov 17, 2020

Based on this, I'm planning to write up some docs within sig-transaction, because Developer docs can do with small improvements and won't affect the end user directly. Any further suggestion on which part of sig-transaction I can expand on will be welcome. For my first task, I'd prefer something than can be done in a handful of days of work.

@nrc
Copy link
Collaborator Author

nrc commented Nov 23, 2020

Based on this, I'm planning to write up some docs within sig-transaction, because Developer docs can do with small improvements and won't affect the end user directly.

Awsome, thank you!

Any further suggestion on which part of sig-transaction I can expand on will be welcome

I think a good thing to do is to pick a module and add some comments on types - it is mostly possible to do that by searching for uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants