Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tx_service/include/cc/cc_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -8769,7 +8769,7 @@ struct ScanSliceDeltaSizeCcForRangePartition : public CcRequestBase
return store_range_.load(std::memory_order_relaxed);
}

bool SetStoreRange(StoreRange *store_range, uint16_t core_id)
bool SetStoreRange(StoreRange *store_range)
{
StoreRange *expect = nullptr;
assert(store_range);
Expand Down
14 changes: 13 additions & 1 deletion tx_service/include/cc/cc_shard.h
Original file line number Diff line number Diff line change
Expand Up @@ -1187,11 +1187,23 @@ class CcShard

void DeleteSchemaCntl(const TableName &tbl_name);

/**
* @brief Create a data sync task for triggering the split range operation.
*
* @param table_name - The name of the table.
* @param ng_id - The id of the node group.
* @param ng_term - The term of the node group.
* @param range_id - The id of the range.
* @param data_sync_ts - The timestamp of the data sync.
* @param is_dirty - Whether the table is dirty (such as the secondary index
* table that is being built).
*/
void CreateSplitRangeDataSyncTask(const TableName &table_name,
uint32_t ng_id,
int64_t ng_term,
int32_t range_id,
uint64_t data_sync_ts);
uint64_t data_sync_ts,
bool is_dirty);

void ClearNativeSchemaCntl();
void CollectCacheHit();
Expand Down
14 changes: 13 additions & 1 deletion tx_service/include/cc/local_cc_shards.h
Original file line number Diff line number Diff line change
Expand Up @@ -1756,11 +1756,23 @@ class LocalCcShards
uint64_t txn,
CcHandlerResult<Void> *hres);

/**
* @brief Create a data sync task for triggering the split range operation.
*
* @param table_name - The name of the table.
* @param ng_id - The id of the node group.
* @param ng_term - The term of the node group.
* @param range_id - The id of the range.
* @param data_sync_ts - The timestamp of the data sync.
* @param is_dirty - Whether the table is dirty (such as the secondary index
* table that is being built).
*/
void CreateSplitRangeDataSyncTask(const TableName &table_name,
uint32_t ng_id,
int64_t ng_term,
int32_t range_id,
uint64_t data_sync_ts);
uint64_t data_sync_ts,
bool is_dirty);

std::pair<TableRangeEntry *, StoreRange *> PinStoreRange(
const TableName &table_name,
Expand Down
9 changes: 5 additions & 4 deletions tx_service/include/cc/template_cc_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ class TemplateCcMap : public CcMap
cc_ng_id_,
cce_addr->Term(),
range_id,
commit_ts);
commit_ts,
false);
}
}
}
Expand Down Expand Up @@ -7362,7 +7363,8 @@ class TemplateCcMap : public CcMap
cc_ng_id_,
req.CcNgTerm(),
static_cast<uint32_t>(partition_id),
data_sync_ts);
data_sync_ts,
req.Kind() == UploadBatchType::SkIndexData);
}
}
}
Expand Down Expand Up @@ -7776,8 +7778,7 @@ class TemplateCcMap : public CcMap
req.StartTxKey(),
&req,
shard_);
if (store_range &&
!req.SetStoreRange(store_range, shard_->core_id_))
if (store_range && !req.SetStoreRange(store_range))
{
// StoreRange already been pinned by other core, unpin
// on the current core.
Expand Down
3 changes: 2 additions & 1 deletion tx_service/src/cc/cc_req_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,8 @@ bool FetchTableRangeSizeCc::Execute(CcShard &ccs)
node_group_id_,
node_group_term_,
partition_id_,
data_sync_ts);
data_sync_ts,
false);
}

return true;
Expand Down
5 changes: 3 additions & 2 deletions tx_service/src/cc/cc_shard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3703,10 +3703,11 @@ void CcShard::CreateSplitRangeDataSyncTask(const TableName &table_name,
uint32_t ng_id,
int64_t ng_term,
int32_t range_id,
uint64_t data_sync_ts)
uint64_t data_sync_ts,
bool is_dirty)
{
local_shards_.CreateSplitRangeDataSyncTask(
table_name, ng_id, ng_term, range_id, data_sync_ts);
table_name, ng_id, ng_term, range_id, data_sync_ts, is_dirty);
}

void CcShard::CollectCacheHit()
Expand Down
5 changes: 3 additions & 2 deletions tx_service/src/cc/local_cc_shards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2949,7 +2949,8 @@ void LocalCcShards::CreateSplitRangeDataSyncTask(const TableName &table_name,
uint32_t ng_id,
int64_t ng_term,
int32_t range_id,
uint64_t data_sync_ts)
uint64_t data_sync_ts,
bool is_dirty)
{
CODE_FAULT_INJECTOR("term_skip_auto_split_range", {
DLOG(INFO) << "FaultInject term_skip_auto_split_range";
Expand All @@ -2970,7 +2971,7 @@ void LocalCcShards::CreateSplitRangeDataSyncTask(const TableName &table_name,
ng_term,
range_entry,
data_sync_ts,
false,
is_dirty,
false,
last_sync_ts,
status,
Expand Down
Loading