@@ -409,6 +409,8 @@ SharedPtr<BlockEntry> SegmentEntry::GetBlockEntryByID(BlockID block_id) const {
409
409
nlohmann::json SegmentEntry::Serialize (TxnTimeStamp max_commit_ts) {
410
410
nlohmann::json json_res;
411
411
412
+ this ->checkpoint_row_count_ = 0 ;
413
+
412
414
// const field
413
415
json_res[" segment_dir" ] = *this ->segment_dir_ ;
414
416
json_res[" row_capacity" ] = this ->row_capacity_ ;
@@ -420,7 +422,6 @@ nlohmann::json SegmentEntry::Serialize(TxnTimeStamp max_commit_ts) {
420
422
json_res[" min_row_ts" ] = this ->min_row_ts_ ;
421
423
json_res[" max_row_ts" ] = std::min (this ->max_row_ts_ , max_commit_ts);
422
424
json_res[" deleted" ] = this ->deleted_ ;
423
- json_res[" row_count" ] = this ->row_count_ ;
424
425
json_res[" actual_row_count" ] = this ->actual_row_count_ ;
425
426
426
427
json_res[" commit_ts" ] = TxnTimeStamp (this ->commit_ts_ );
@@ -436,8 +437,11 @@ nlohmann::json SegmentEntry::Serialize(TxnTimeStamp max_commit_ts) {
436
437
if (block_entry->commit_ts_ <= max_commit_ts) {
437
438
block_entry->Flush (max_commit_ts);
438
439
json_res[" block_entries" ].emplace_back (block_entry->Serialize (max_commit_ts));
440
+ this ->checkpoint_row_count_ += block_entry->checkpoint_row_count ();
439
441
}
440
442
}
443
+
444
+ json_res[" row_count" ] = this ->checkpoint_row_count_ ;
441
445
}
442
446
return json_res;
443
447
}
@@ -455,6 +459,7 @@ SharedPtr<SegmentEntry> SegmentEntry::Deserialize(const nlohmann::json &segment_
455
459
segment_entry->max_row_ts_ = segment_entry_json[" max_row_ts" ];
456
460
segment_entry->row_count_ = segment_entry_json[" row_count" ];
457
461
segment_entry->actual_row_count_ = segment_entry_json[" actual_row_count" ];
462
+ segment_entry->checkpoint_row_count_ = 0 ;
458
463
459
464
segment_entry->commit_ts_ = segment_entry_json[" commit_ts" ];
460
465
segment_entry->begin_ts_ = segment_entry_json[" begin_ts" ];
0 commit comments