Skip to content

Commit

Permalink
[fix](load) fix merged row number miscounting because of race conditi…
Browse files Browse the repository at this point in the history
…on (#26470)

row numbers miscounting because of race condition, will cause load to
fail sometimes with warning 'the rows number written doesn't match'.

Signed-off-by: freemandealer <freeman.zhang1992@gmail.com>
  • Loading branch information
freemandealer authored Nov 6, 2023
1 parent eeb8704 commit bf8793d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion be/src/olap/delta_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class DeltaWriter {
std::shared_mutex _slave_node_lock;

// total rows num written by DeltaWriter
int64_t _total_received_rows = 0;
std::atomic<int64_t> _total_received_rows = 0;

RuntimeProfile* _profile = nullptr;
RuntimeProfile::Counter* _close_wait_timer = nullptr;
Expand Down
8 changes: 4 additions & 4 deletions be/src/olap/memtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ class MemTableStat {
return *this;
}

int64_t raw_rows = 0;
int64_t merged_rows = 0;
std::atomic<int64_t> raw_rows = 0;
std::atomic<int64_t> merged_rows = 0;
int64_t sort_ns = 0;
int64_t agg_ns = 0;
int64_t put_into_output_ns = 0;
int64_t duration_ns = 0;
int64_t sort_times = 0;
int64_t agg_times = 0;
std::atomic<int64_t> sort_times = 0;
std::atomic<int64_t> agg_times = 0;
};

class MemTable {
Expand Down

0 comments on commit bf8793d

Please sign in to comment.