v5.1.4 mvcc 测试
create table t123 (id int primary key,name varchar(100),age int,city varchar(100));
insert into t123 values (1,‘user1’,1,‘bj’);
update t123 set name=‘user2’ where id=1;
update t123 set name=‘user3’ where id=1;
[]# curl http://192.168.1.13:10080/mvcc/key/test/t123/1
{
“key”: “748000000000000C0B5F728000000000000001”,
“region_id”: 75055,
“value”: {
“info”: {
“writes”: [
{
“start_ts”: 437878836284620809,
“commit_ts”: 437878836284620812,
“short_value”: “gAADAAAAAgMEBQAGAAgAdXNlcjMBYmo=”
},
{
“start_ts”: 437878822036832288,
“commit_ts”: 437878822049939459,
“short_value”: “gAADAAAAAgMEBQAGAAgAdXNlcjIBYmo=”
},
{
“start_ts”: 437878822036832283,
“commit_ts”: 437878822036832284,
“short_value”: “gAADAAAAAgMEBQAGAAgAdXNlcjEBYmo=”
}
]
}
}
}
当前gc信息
select VARIABLE_NAME, VARIABLE_VALUE from mysql.tidb;
| tikv_gc_last_run_time | 20221207-08:56:56 +0800
| tikv_gc_safe_point | 20221207-08:46:56 +0800
等 gc 之后,再次查看 mvcc 数据,如下
select VARIABLE_NAME, VARIABLE_VALUE from mysql.tidb;
| tikv_gc_last_run_time | 20221207-09:16:56 +0800
| tikv_gc_safe_point | 20221207-09:06:56 +0800
[]# curl http://192.168.1.13:10080/mvcc/key/test/t123/1
{
“key”: “748000000000000C0B5F728000000000000001”,
“region_id”: 75055,
“value”: {
“info”: {
“writes”: [
{
“start_ts”: 437878836284620809,
“commit_ts”: 437878836284620812,
“short_value”: “gAADAAAAAgMEBQAGAAgAdXNlcjMBYmo=”
},
{
“start_ts”: 437878822036832288,
“commit_ts”: 437878822049939459,
“short_value”: “gAADAAAAAgMEBQAGAAgAdXNlcjIBYmo=”
},
{
“start_ts”: 437878822036832283,
“commit_ts”: 437878822036832284,
“short_value”: “gAADAAAAAgMEBQAGAAgAdXNlcjEBYmo=”
}
]
}
}
}
测试结果:
不符合预期,为什么gc之后,这行数据的mvcc数据还是存在的?