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
1 change: 1 addition & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ DEFINE_mBool(enable_delete_bitmap_merge_on_compaction, "false");

// Enable validation to check the correctness of table size.
DEFINE_Bool(enable_table_size_correctness_check, "false");
DEFINE_Bool(force_regenerate_rowsetid_on_start_error, "false");

// clang-format off
#ifdef BE_TEST
Expand Down
1 change: 1 addition & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,7 @@ DECLARE_mBool(enable_pipeline_task_leakage_detect);

// MB
DECLARE_Int32(query_cache_size);
DECLARE_Bool(force_regenerate_rowsetid_on_start_error);

DECLARE_mBool(enable_delete_bitmap_merge_on_compaction);

Expand Down
10 changes: 9 additions & 1 deletion be/src/olap/olap_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <unordered_set>
#include <utility>

#include "common/config.h"
#include "io/io_common.h"
#include "olap/olap_define.h"
#include "olap/rowset/rowset_fwd.h"
Expand Down Expand Up @@ -394,6 +395,8 @@ using ColumnId = uint32_t;
using UniqueIdSet = std::set<uint32_t>;
// Column unique Id -> column id map
using UniqueIdToColumnIdMap = std::map<ColumnId, ColumnId>;
struct RowsetId;
RowsetId next_rowset_id();

// 8 bit rowset id version
// 56 bit, inc number from 1
Expand All @@ -412,7 +415,12 @@ struct RowsetId {
auto [_, ec] = std::from_chars(rowset_id_str.data(),
rowset_id_str.data() + rowset_id_str.length(), high);
if (ec != std::errc {}) [[unlikely]] {
LOG(FATAL) << "failed to init rowset id: " << rowset_id_str;
if (config::force_regenerate_rowsetid_on_start_error) {
LOG(WARNING) << "failed to init rowset id: " << rowset_id_str;
high = next_rowset_id().hi;
} else {
LOG(FATAL) << "failed to init rowset id: " << rowset_id_str;
}
}
init(1, high, 0, 0);
} else {
Expand Down
9 changes: 9 additions & 0 deletions be/src/olap/rowset/unique_rowset_id_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@

#include "olap/rowset/unique_rowset_id_generator.h"

#include <atomic>

#include "olap/storage_engine.h"
#include "runtime/exec_env.h"

namespace doris {

RowsetId next_rowset_id() {
return ExecEnv::GetInstance()->storage_engine().next_rowset_id();
}

UniqueRowsetIdGenerator::UniqueRowsetIdGenerator(const UniqueId& backend_uid)
: _backend_uid(backend_uid), _inc_id(1) {}

Expand Down