Skip to content

Commit

Permalink
fix: for code review
Browse files Browse the repository at this point in the history
  • Loading branch information
wy1433 committed Apr 11, 2024
1 parent 85b6599 commit 43c805d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/engine/rocks_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ int32_t RocksWrapper::init(const std::string& path) {
_data_cf_option.enable_blob_files = true;
_data_cf_option.min_blob_size = FLAGS_min_blob_size;
_data_cf_option.blob_file_size = 1ULL << 28;
_data_cf_option.blob_compression_type = rocksdb::CompressionType::kLZ4HCCompression;
_data_cf_option.blob_compression_type = rocksdb::CompressionType::kLZ4Compression;
_data_cf_option.enable_blob_garbage_collection = true;
_data_cf_option.blob_garbage_collection_age_cutoff = 0.25;
_data_cf_option.blob_garbage_collection_force_threshold = 0.8;
Expand Down
6 changes: 1 addition & 5 deletions src/exec/rocksdb_scan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ DEFINE_bool(reverse_seek_first_level, false, "reverse index seek first level, de
DEFINE_bool(scan_use_multi_get, true, "use MultiGet API, default(true)");
DEFINE_int32(in_predicate_check_threshold, 4096, "in predicate threshold to check memory, default(4096)");
DECLARE_int64(print_time_us);
DEFINE_bool(ignore_new_field_error, false, "ignore field not found when add field return NULL");

int RocksdbScanNode::choose_index(RuntimeState* state) {
// 做完logical plan还没有索引
Expand Down Expand Up @@ -474,10 +473,7 @@ int RocksdbScanNode::open(RuntimeState* state) {
for (auto& slot : _tuple_desc->slots()) {
if (slot.field_id() > _field_slot.size() - 1) {
DB_WARNING("vector out of range, region_id: %ld, field_id: %d", _region_id, slot.field_id());
if (FLAGS_ignore_new_field_error) {
continue;
}
return -1;
continue;
}
_field_slot[slot.field_id()] = slot.slot_id();
if (pri_field_ids.count(slot.field_id()) == 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/store/region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,12 +1837,12 @@ void Region::dml_2pc(const pb::StoreReq& request,
// 只有leader有事务情况才能在raft外执行
if (applied_index == 0 && term == 0 && !is_leader()) {
// 非leader才返回
auto leader = butil::endpoint2str(get_leader()).c_str();
response.set_leader(leader);
const std::string& leader = butil::endpoint2str(get_leader());
response.set_leader(leader.c_str());
response.set_errcode(pb::NOT_LEADER);
response.set_errmsg("not leader");
DB_WARNING("not in raft, not leader, leader:%s, region_id: %ld, log_id:%lu",
leader, _region_id, request.log_id());
leader.c_str(), _region_id, request.log_id());
return;
}

Expand Down

0 comments on commit 43c805d

Please sign in to comment.