@@ -48,10 +48,20 @@ type BackfillTaskMeta struct {
4848 // For now, only index type is supported.
4949 EleTypeKey []byte `json:"ele_type_key"`
5050
51- CloudStorageURI string `json:"cloud_storage_uri"`
52- EstimateRowSize int `json:"estimate_row_size"`
53- MergeTempIndex bool `json:"merge_temp_index"`
54- InitialTiKVStoreUsage * TiKVStoreUsageSnapshot `json:"initial_tikv_store_usage,omitempty"`
51+ CloudStorageURI string `json:"cloud_storage_uri"`
52+ EstimateRowSize int `json:"estimate_row_size"`
53+ MergeTempIndex bool `json:"merge_temp_index"`
54+ InitialTiKVStoreUsage * TiKVStoreUsageSnapshot `json:"initial_tikv_store_usage,omitempty"`
55+ InitialTiKVCapacity * TiKVClusterCapacity `json:"initial_tikv_capacity,omitempty"`
56+ BasicPredictedTiKVIndexBytes uint64 `json:"basic_predicted_tikv_index_bytes,omitempty"`
57+ RepresentPredictedTiKVIndexBytes uint64 `json:"represent_predicted_tikv_index_bytes,omitempty"`
58+ SamplePredictedTiKVIndexBytes uint64 `json:"sample_predicted_tikv_index_bytes,omitempty"`
59+ SamplePredictionRegionCount int `json:"sample_prediction_region_count,omitempty"`
60+ SamplePredictionRowCount int `json:"sample_prediction_row_count,omitempty"`
61+ SamplePredictionReadErrorCount int `json:"sample_prediction_read_error_count,omitempty"`
62+ // PredictedTiKVIndexBytes is kept for compatibility with task metadata written by
63+ // earlier builds. New task submissions store the sample-model prediction here.
64+ PredictedTiKVIndexBytes uint64 `json:"predicted_tikv_index_bytes,omitempty"`
5565
5666 Version int `json:"version,omitempty"`
5767}
@@ -62,6 +72,24 @@ type TiKVStoreUsageSnapshot struct {
6272 StoreCount int `json:"store_count"`
6373}
6474
75+ // TiKVStoreCapacity contains per-store capacity details needed by DXF add-index
76+ // capacity precheck and post-task observation.
77+ type TiKVStoreCapacity struct {
78+ StoreID int64 `json:"store_id"`
79+ TotalBytes uint64 `json:"total_bytes"`
80+ AvailableBytes uint64 `json:"available_bytes"`
81+ UsedBytes uint64 `json:"used_bytes"`
82+ }
83+
84+ // TiKVClusterCapacity is the aggregated TiKV capacity snapshot collected from PD.
85+ type TiKVClusterCapacity struct {
86+ TotalBytes uint64 `json:"total_bytes"`
87+ AvailableBytes uint64 `json:"available_bytes"`
88+ UsedBytes uint64 `json:"used_bytes"`
89+ StoreCount int `json:"store_count"`
90+ Stores []TiKVStoreCapacity `json:"stores,omitempty"`
91+ }
92+
6593// BackfillSubTaskMeta is the sub-task meta for backfilling index.
6694type BackfillSubTaskMeta struct {
6795 external.BaseExternalMeta
0 commit comments