Skip to content

Support fetch tiflash system table and compact table through grpc service#28

Merged
JaySon-Huang merged 10 commits intomainfrom
grpc_sql
Jun 24, 2025
Merged

Support fetch tiflash system table and compact table through grpc service#28
JaySon-Huang merged 10 commits intomainfrom
grpc_sql

Conversation

@JaySon-Huang
Copy link
Copy Markdown
Owner

@JaySon-Huang JaySon-Huang commented Jun 23, 2025

Fetch tiflash system table

-- fetch tiflash system table
./bin/tiflash-ctl dispatch exec_sql --pd 10.2.12.81:6580 --flash 10.2.12.81:9580 --sql 'select table_id,total_stable_size,total_stable_size_on_disk,round(avg_stable_rows,0),round(avg_stable_size,0),segment_count,delta_index_size,total_pack_count_in_delta,delta_cache_size,total_delta_rows,total_delta_size,delta_count,round(avg_delta_rows,0),round(avg_delta_size,0) from system.dt_tables order by total_stable_size_on_disk desc limit 100' --decimal 0
table_id,total_stable_size,total_stable_size_on_disk,"round(avg_stable_rows, 0)","round(avg_stable_size, 0)",segment_count,delta_index_size,total_pack_count_in_delta,delta_cache_size,total_delta_rows,total_delta_size,delta_count,"round(avg_delta_rows, 0)","round(avg_delta_size, 0)"
243,64949902442,44976036865,909091,393635772,165,76038408,1957,4897636,3094288,1339832273,165,18753,8120196
233,31045642277,22710964961,681818,470388519,66,134112,683,4264909,588318,408923253,66,8914,6195807
241,43035474905,16127717610,777024,73817281,583,25933560,1175,9335365,1131777,107518815,226,5008,475747
235,3575467823,1091313746,853605,67461657,53,1384440,24,0,55002,4675170,1,55002,4675170
239,2627724568,569782475,924604,53627032,49,0,0,0,0,0,0,NULL,NULL
237,398617499,62370125,916362,26574500,15,8244680,181,46690,332445,9640905,15,22163,642727
245,10800645,7356523,100000,10800645,1,0,0,0,0,0,0,NULL,NULL
231,2519021,1254261,15000,2519021,1,0,0,0,0,0,0,NULL,NULL
229,238308,128365,1500,238308,1,0,0,0,0,0,0,NULL,NULL
102,390,351,13,390,1,0,0,0,0,0,0,NULL,NULL
92,0,0,NULL,NULL,0,0,0,0,0,0,0,NULL,NULL
259,0,0,NULL,NULL,1,2032,1,0,25,3334,1,25,3334
261,0,0,NULL,NULL,1,2032,1,0,5,584,1,5,584
263,0,0,NULL,NULL,1,2032,1,0,10000,1975466,1,10000,1975466

Compact a given table_id

./bin/tiflash-ctl dispatch compact --pd 10.2.12.81:6580 --flash 10.2.12.81:9580 --table_id 239 --start_key 30088000000001ed6988
[2025/06/24 22:20:03.782 +08:00] [INFO] [client.go:311] ["[pd] create pd client with endpoints and keyspace"] [pd-address="[10.2.12.81:6580]"] [keyspace-id=0]
[2025/06/24 22:20:03.786 +08:00] [INFO] [pd_service_discovery.go:543] ["[pd] switch leader"] [new-leader=http://10.2.12.81:6580] [old-leader=]
[2025/06/24 22:20:03.786 +08:00] [INFO] [pd_service_discovery.go:175] ["[pd] init cluster id"] [cluster-id=7516814964136016887]
[2025/06/24 22:20:03.786 +08:00] [INFO] [client.go:386] ["[pd] changing service mode"] [old-mode=UNKNOWN_SVC_MODE] [new-mode=PD_SVC_MODE]
[2025/06/24 22:20:03.787 +08:00] [INFO] [tso_client.go:230] ["[tso] switch dc tso allocator serving address"] [dc-location=global] [new-address=http://10.2.12.81:6580]
[2025/06/24 22:20:03.787 +08:00] [INFO] [tso_dispatcher.go:290] ["[tso] tso dispatcher created"] [dc-location=global]
[2025/06/24 22:20:03.787 +08:00] [INFO] [client.go:428] ["[pd] service mode changed"] [old-mode=PD_SVC_MODE] [new-mode=PD_SVC_MODE]
[2025/06/24 22:20:03.789 +08:00] [INFO] [dispatch.go:351] ["Compact TiFlash table"] [physical_table_id=239] [store=10.2.12.81:9580] [start_key=30088000000001ed6988]
[2025/06/24 22:20:29.556 +08:00] [INFO] [dispatch.go:379] ["Compact finished"] [physical_table_id=239]
[2025/06/24 22:20:29.556 +08:00] [INFO] [dispatch.go:400] ["Compact command finished"] [physical_table_id=239] [success=true] [key=30088000000001ed6988]

Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang JaySon-Huang merged commit edbe1b3 into main Jun 24, 2025
1 check passed
@JaySon-Huang JaySon-Huang deleted the grpc_sql branch June 24, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant