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

Incubating Program: make PITR production-ready #126

Open
WangXiangUSTC opened this issue Dec 9, 2019 · 2 comments
Open

Incubating Program: make PITR production-ready #126

WangXiangUSTC opened this issue Dec 9, 2019 · 2 comments
Labels
incubating-request/project This is an Incubating Program request for a project status/LGT2 Indicates that a PR has LGTM 2.

Comments

@WangXiangUSTC
Copy link

WangXiangUSTC commented Dec 9, 2019

Introduce

github: https://github.com/lvleiice/Better-PITR

PITR is an ecosystem tool for TiDB Binlog. By preprocessing the incremental backup file of TiDB, PITR merged the changes of the same line of data to produce a new, lighter incremental backup file, which greatly reduced the Time of incremental backup Recovery and realized fast-pitr (Fast Point in Time Recovery).

For example

There is a table t1, it's schema is: create table t1 (id int primary key, name varchar(24)). And now we execute four SQLs in TiDB:

insert into t1 values(1, “a”);
insert into t1 values(2, “b”);
update t1 set name = “c” where id = 1;
delete from t1 where id = 2;

These SQLs will generate four binlog, restore binlog using Reparo tool data to downstream will execute four SQLs in downstream database. These binlogs are actually can merged to generate an insert into t1 values(1, "c"); This will save a quarter as much space as before and restore the files four times as fast. We can think of it simply: the binlog file produced by Drainer is compressed/preprocessed by PITR.

Current Situation

PITR is a Hackathon project, so it only implements the basic functionality, has some known problems, and lacks testing, so there may be more unknown problems. We need to solve the below problems, and make PITR production-ready.

Bug

  • PITR needs to maintain the table structure information (to parse the binlog data) but will report an error if there is no database information in the DDL.

Performance

  • PITR retrieves TiDB's historical DDL information to build the table structure of the initial state, and executes the DDL in PITR's built-in TiDB to retrieve the table structure. If the history of DDL is large, the initialization state can be very slow. (defective design)

Test

  • Unit test coverage was 63.8%
  • No integration testing

Usability

  • PITR does not output meta information, such as the location of the file to run the processing, or the time period during which binlog was processed (the binlog commit ts at the beginning and the binlog commit ts at the end).

Estimated Time

3(Developers) * 7(days)

@siddontang
Copy link
Member

LGTM

@WangXiangUSTC WangXiangUSTC added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 9, 2019
@winkyao
Copy link
Contributor

winkyao commented Dec 9, 2019

LGTM

@winkyao winkyao added incubating-request/project This is an Incubating Program request for a project status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 9, 2019
rleungx pushed a commit to rleungx/community that referenced this issue Mar 17, 2022
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incubating-request/project This is an Incubating Program request for a project status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

No branches or pull requests

3 participants