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

server: support partitioned table for the /mvcc/* HTTP API (#14197) #16191

Merged
merged 6 commits into from
Apr 8, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 8, 2020

cherry-pick #14197 to release-3.0


What problem does this PR solve?

mysql> show create table xx;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                                                                                                                     |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| xx    | CREATE TABLE `xx` (
  `id` int(11) DEFAULT NULL,
  `ts` timestamp NULL DEFAULT NULL,
  KEY `i_ts` (`ts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY RANGE ( `id` ) (
  PARTITION p0 VALUES LESS THAN (1),
  PARTITION p1 VALUES LESS THAN (100),
  PARTITION p2 VALUES LESS THAN (1000),
  PARTITION pn VALUES LESS THAN (10000)
) |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select * from xx;
+------+---------------------+
| id   | ts                  |
+------+---------------------+
|    1 | 2019-12-30 12:23:33 |
+------+---------------------+
1 row in set (0.01 sec)

Use the table(partition) name pattern to work on the partitioned table.

➜  tidb git:(mvcc-http-api) curl 'http://127.0.0.1:10080/mvcc/key/test/xx(p1)/1'  
{
 "key": "7480000000000000515F728000000000000001",
 "region_id": 1017,
 "value": {
  "info": {
   "writes": [
    {
     "start_ts": 413431571564199937,
     "commit_ts": 413431571577307137,
     "short_value": "CAIIAggECYCAgIjeiL/SGQ=="
    }
   ]
  }
 }
}
➜  tidb git:(mvcc-http-api) curl http://127.0.0.1:10080/mvcc/index/test/xx\(p1\)/i_ts/1\?ts\=2019-12-30%2004:23:33 
{
 "key": "7480000000000000515F6980000000000000010419A4FC45E1000000038000000000000001",
 "region_id": 1017,
 "value": {
  "info": {
   "writes": [
    {
     "start_ts": 413431571564199937,
     "commit_ts": 413431571577307137,
     "short_value": "MA=="
    }
   ]
  }
 }
}

What is changed and how it works?

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Related changes

  • Need to update the documentation

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 8, 2020

/run-all-tests

@tiancaiamao
Copy link
Contributor

PTAL @zimulala @Deardrops @jackysp

Copy link
Contributor

@Deardrops Deardrops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Apr 8, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 8, 2020

/run-all-tests

@zz-jason zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label Apr 8, 2020
@zz-jason zz-jason removed the request for review from jackysp April 8, 2020 12:01
@ngaut ngaut merged commit e9ecbc1 into pingcap:release-3.0 Apr 8, 2020
bobotu pushed a commit to bobotu/tidb that referenced this pull request Apr 9, 2020
qw4990 pushed a commit to qw4990/tidb that referenced this pull request May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement. type/3.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants