fix build error for inc_build_test regression
This commit is contained in:
parent
f73a504473
commit
97d2270c0d
@ -171,31 +171,7 @@ int ObDataDictIterator::next_dict_header(ObDictMetaHeader &header)
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class DICT_ENTRY>
|
||||
int ObDataDictIterator::next_dict_entry(DICT_ENTRY &dict_entry)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
if (dict_pos_ > 0) {
|
||||
// deserialize from dict_buf_
|
||||
int64_t deserialize_pos = 0;
|
||||
if (OB_FAIL(dict_entry.deserialize(dict_buf_, dict_pos_, deserialize_pos))) {
|
||||
DDLOG(WARN, "deserialize DICT_ENTRY from dict_buf failed", KR(ret),
|
||||
K_(dict_pos), K(deserialize_pos));
|
||||
}
|
||||
} else if (palf_pos_ > 0) {
|
||||
// deserialize from dict_buf_
|
||||
if (OB_FAIL(dict_entry.deserialize(palf_buf_, palf_buf_len_, palf_pos_))) {
|
||||
DDLOG(WARN, "deserialize DICT_ENTRY from palf_buf failed", KR(ret),
|
||||
K_(palf_buf_len), K_(palf_pos));
|
||||
}
|
||||
} else {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
DDLOG(WARN, "expect any of dict_pos/palf_pos is valid", KR(ret), K_(palf_pos), K_(dict_pos));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObDataDictIterator::append_log_buf_with_base_header_(const char *buf, const int64_t buf_len)
|
||||
{
|
||||
|
@ -34,7 +34,30 @@ public:
|
||||
int append_log_buf(const char *buf, const int64_t buf_len, const int64_t pos); // without log_base_header
|
||||
int next_dict_header(ObDictMetaHeader &meta_header);
|
||||
template<class DICT_ENTRY>
|
||||
int next_dict_entry(DICT_ENTRY &dict_entry);
|
||||
int next_dict_entry(DICT_ENTRY &dict_entry)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
if (dict_pos_ > 0) {
|
||||
// deserialize from dict_buf_
|
||||
int64_t deserialize_pos = 0;
|
||||
if (OB_FAIL(dict_entry.deserialize(dict_buf_, dict_pos_, deserialize_pos))) {
|
||||
DDLOG(WARN, "deserialize DICT_ENTRY from dict_buf failed", KR(ret),
|
||||
K_(dict_pos), K(deserialize_pos));
|
||||
}
|
||||
} else if (palf_pos_ > 0) {
|
||||
// deserialize from dict_buf_
|
||||
if (OB_FAIL(dict_entry.deserialize(palf_buf_, palf_buf_len_, palf_pos_))) {
|
||||
DDLOG(WARN, "deserialize DICT_ENTRY from palf_buf failed", KR(ret),
|
||||
K_(palf_buf_len), K_(palf_pos));
|
||||
}
|
||||
} else {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
DDLOG(WARN, "expect any of dict_pos/palf_pos is valid", KR(ret), K_(palf_pos), K_(dict_pos));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
private:
|
||||
OB_INLINE void release_palf_buf_()
|
||||
{
|
||||
|
@ -149,49 +149,6 @@ int ObDataDictStorage::prepare(const share::SCN &snapshot_scn, ObLogHandler *log
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class DATA_DICT_META>
|
||||
int ObDataDictStorage::handle_dict_meta(
|
||||
const DATA_DICT_META &data_dict_meta,
|
||||
ObDictMetaHeader &header)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
const int64_t dict_serialize_size = data_dict_meta.get_serialize_size();
|
||||
// serialize_header
|
||||
header.set_snapshot_scn(snapshot_scn_);
|
||||
header.set_dict_serialize_length(dict_serialize_size);
|
||||
header.set_storage_type(ObDictMetaStorageType::FULL);
|
||||
const int64_t header_serialize_size = header.get_serialize_size();
|
||||
const int64_t total_serialize_size = dict_serialize_size
|
||||
+ header_serialize_size
|
||||
+ log_base_header_.get_serialize_size();
|
||||
|
||||
if (! need_new_palf_buf_(total_serialize_size)) {
|
||||
if (OB_FAIL(serialize_to_palf_buf_(header, data_dict_meta))) {
|
||||
DDLOG(WARN, "serialize header_and_dict to palf_buf_ failed", KR(ret), K(header), K(data_dict_meta));
|
||||
}
|
||||
} else if (OB_FAIL(submit_to_palf_())) {
|
||||
DDLOG(WARN, "submit_data_dict_to_palf_ failed", KR(ret), K_(palf_buf_len), K_(palf_pos));
|
||||
} else if (! need_new_palf_buf_(total_serialize_size)) {
|
||||
// check if palf_buf_len is enough for header + data_dict.
|
||||
if (OB_FAIL(serialize_to_palf_buf_(header, data_dict_meta))) {
|
||||
DDLOG(WARN, "serialize header_and_dict to palf_buf_ failed", KR(ret), K(header), K(data_dict_meta));
|
||||
}
|
||||
} else if (OB_FAIL(prepare_dict_buf_(dict_serialize_size))) {
|
||||
DDLOG(WARN, "prepare_dict_buf_ failed", KR(ret), K(dict_serialize_size), K_(dict_buf_len), K_(dict_pos));
|
||||
} else if (OB_FAIL(data_dict_meta.serialize(dict_buf_, dict_buf_len_, dict_pos_))) {
|
||||
DDLOG(WARN, "serialize data_dict_meta to dict_buf failed", KR(ret),
|
||||
K(dict_serialize_size), K_(dict_buf_len), K_(dict_pos));
|
||||
} else if (OB_FAIL(segment_dict_buf_to_palf_(header))) {
|
||||
DDLOG(WARN, "segment_dict_buf_to_palf_ failed", KR(ret), K(header), K_(dict_buf_len), K_(dict_pos), K_(palf_pos));
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
DDLOG(TRACE, "handle data_dict success", K(header), K(data_dict_meta));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObDataDictStorage::finish(
|
||||
palf::LSN &start_lsn,
|
||||
palf::LSN &end_lsn,
|
||||
@ -426,39 +383,6 @@ int ObDataDictStorage::prepare_dict_buf_(const int64_t required_size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class DATA_DICT_META>
|
||||
int ObDataDictStorage::serialize_to_palf_buf_(
|
||||
const ObDictMetaHeader &header,
|
||||
const DATA_DICT_META &data_dict)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
if (OB_ISNULL(palf_buf_)) {
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
DDLOG(WARN, "palf_buf shoule be valid", KR(ret));
|
||||
} else if (palf_pos_ == 0) {
|
||||
if (OB_FAIL(serialize_log_base_header_())) {
|
||||
DDLOG(WARN, "serialize_log_base_header_ failed", KR(ret), K_(palf_pos));
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_FAIL(header.serialize(palf_buf_, palf_buf_len_, palf_pos_))) {
|
||||
DDLOG(WARN, "serialize header to palf_buf failed", KR(ret), K(header),
|
||||
K_(palf_buf_len), K_(palf_pos), "header_serialize_size", header.get_serialize_size());
|
||||
} else if (OB_FAIL(data_dict.serialize(palf_buf_, palf_buf_len_, palf_pos_))) {
|
||||
DDLOG(WARN, "serialize data_dict to palf_buf failed", KR(ret), K(header), K(data_dict),
|
||||
K_(palf_buf_len), K_(palf_pos), "dict_serialize_size", data_dict.get_serialize_size());
|
||||
} else {
|
||||
DDLOG(DEBUG, "serialize data_dict to palf_buf success", KR(ret), K(header), K(data_dict),
|
||||
K_(palf_buf_len), K_(palf_pos),
|
||||
"header_size", header.get_serialize_size(),
|
||||
"data_dict_size", data_dict.get_serialize_size());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObDataDictStorage::segment_dict_buf_to_palf_(ObDictMetaHeader &header)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
@ -44,7 +44,45 @@ public:
|
||||
template<class DATA_DICT_META>
|
||||
int handle_dict_meta(
|
||||
const DATA_DICT_META &data_dict_meta,
|
||||
ObDictMetaHeader &header);
|
||||
ObDictMetaHeader &header)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
const int64_t dict_serialize_size = data_dict_meta.get_serialize_size();
|
||||
// serialize_header
|
||||
header.set_snapshot_scn(snapshot_scn_);
|
||||
header.set_dict_serialize_length(dict_serialize_size);
|
||||
header.set_storage_type(ObDictMetaStorageType::FULL);
|
||||
const int64_t header_serialize_size = header.get_serialize_size();
|
||||
const int64_t total_serialize_size = dict_serialize_size
|
||||
+ header_serialize_size
|
||||
+ log_base_header_.get_serialize_size();
|
||||
|
||||
if (! need_new_palf_buf_(total_serialize_size)) {
|
||||
if (OB_FAIL(serialize_to_palf_buf_(header, data_dict_meta))) {
|
||||
DDLOG(WARN, "serialize header_and_dict to palf_buf_ failed", KR(ret), K(header), K(data_dict_meta));
|
||||
}
|
||||
} else if (OB_FAIL(submit_to_palf_())) {
|
||||
DDLOG(WARN, "submit_data_dict_to_palf_ failed", KR(ret), K_(palf_buf_len), K_(palf_pos));
|
||||
} else if (! need_new_palf_buf_(total_serialize_size)) {
|
||||
// check if palf_buf_len is enough for header + data_dict.
|
||||
if (OB_FAIL(serialize_to_palf_buf_(header, data_dict_meta))) {
|
||||
DDLOG(WARN, "serialize header_and_dict to palf_buf_ failed", KR(ret), K(header), K(data_dict_meta));
|
||||
}
|
||||
} else if (OB_FAIL(prepare_dict_buf_(dict_serialize_size))) {
|
||||
DDLOG(WARN, "prepare_dict_buf_ failed", KR(ret), K(dict_serialize_size), K_(dict_buf_len), K_(dict_pos));
|
||||
} else if (OB_FAIL(data_dict_meta.serialize(dict_buf_, dict_buf_len_, dict_pos_))) {
|
||||
DDLOG(WARN, "serialize data_dict_meta to dict_buf failed", KR(ret),
|
||||
K(dict_serialize_size), K_(dict_buf_len), K_(dict_pos));
|
||||
} else if (OB_FAIL(segment_dict_buf_to_palf_(header))) {
|
||||
DDLOG(WARN, "segment_dict_buf_to_palf_ failed", KR(ret), K(header), K_(dict_buf_len), K_(dict_pos), K_(palf_pos));
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
DDLOG(TRACE, "handle data_dict success", K(header), K(data_dict_meta));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
int finish(
|
||||
palf::LSN &start_lsn,
|
||||
palf::LSN &end_lsn,
|
||||
@ -90,7 +128,36 @@ private:
|
||||
template<class DATA_DICT_META>
|
||||
int serialize_to_palf_buf_(
|
||||
const ObDictMetaHeader &header,
|
||||
const DATA_DICT_META &data_dict);
|
||||
const DATA_DICT_META &data_dict)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
if (OB_ISNULL(palf_buf_)) {
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
DDLOG(WARN, "palf_buf shoule be valid", KR(ret));
|
||||
} else if (palf_pos_ == 0) {
|
||||
if (OB_FAIL(serialize_log_base_header_())) {
|
||||
DDLOG(WARN, "serialize_log_base_header_ failed", KR(ret), K_(palf_pos));
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_FAIL(header.serialize(palf_buf_, palf_buf_len_, palf_pos_))) {
|
||||
DDLOG(WARN, "serialize header to palf_buf failed", KR(ret), K(header),
|
||||
K_(palf_buf_len), K_(palf_pos), "header_serialize_size", header.get_serialize_size());
|
||||
} else if (OB_FAIL(data_dict.serialize(palf_buf_, palf_buf_len_, palf_pos_))) {
|
||||
DDLOG(WARN, "serialize data_dict to palf_buf failed", KR(ret), K(header), K(data_dict),
|
||||
K_(palf_buf_len), K_(palf_pos), "dict_serialize_size", data_dict.get_serialize_size());
|
||||
} else {
|
||||
DDLOG(DEBUG, "serialize data_dict to palf_buf success", KR(ret), K(header), K(data_dict),
|
||||
K_(palf_buf_len), K_(palf_pos),
|
||||
"header_size", header.get_serialize_size(),
|
||||
"data_dict_size", data_dict.get_serialize_size());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int segment_dict_buf_to_palf_(ObDictMetaHeader &header);
|
||||
int alloc_palf_cb_(ObDataDictPersistCallback *&callback);
|
||||
int update_palf_lsn_(const palf::LSN &lsn);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "observer/mysql/obmp_stmt_send_piece_data.h"
|
||||
#include "rpc/obmysql/packet/ompk_piece.h"
|
||||
#include "observer/omt/ob_tenant.h"
|
||||
#include "sql/plan_cache/ob_ps_cache.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "observer/ob_req_time_service.h"
|
||||
#include "observer/omt/ob_tenant.h"
|
||||
#include "observer/mysql/obsm_utils.h"
|
||||
#include "sql/plan_cache/ob_ps_cache.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "observer/virtual_table/ob_all_virtual_tablet_info.h"
|
||||
#include "storage/tx_storage/ob_ls_service.h"
|
||||
#include "share/scn.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
using namespace oceanbase::common;
|
||||
using namespace oceanbase::storage;
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "share/ob_lob_access_utils.h"
|
||||
#include "sql/engine/expr/ob_expr_lob_utils.h"
|
||||
#include "storage/ob_tenant_tablet_stat_mgr.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "storage/memtable/ob_memtable.h"
|
||||
#include "ob_table_estimator.h"
|
||||
#include "ob_index_sstable_estimator.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "observer/omt/ob_tenant_config_mgr.h"
|
||||
#include "share/ob_tablet_meta_table_compaction_operator.h"
|
||||
#include "storage/compaction/ob_compaction_util.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "storage/compaction/ob_partition_merge_policy.h"
|
||||
#include "share/tablet/ob_tablet_filter.h"
|
||||
#include "share/ob_tablet_meta_table_compaction_operator.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include "share/scheduler/ob_dag_scheduler.h"
|
||||
#include "storage/blocksstable/ob_sstable.h"
|
||||
#include "storage/compaction/ob_medium_compaction_mgr.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
using namespace common;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "storage/tx_storage/ob_ls_service.h"
|
||||
#include "storage/ls/ob_ls.h"
|
||||
#include "storage/ob_sstable_struct.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "ob_tablet_merge_ctx.h"
|
||||
#include "ob_tablet_merge_task.h"
|
||||
#include "ob_tx_table_merge_task.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "logservice/ob_log_service.h"
|
||||
#include "observer/ob_server_event_history_table_operator.h"
|
||||
#include "storage/tablet/ob_tablet_iterator.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
|
||||
using namespace oceanbase;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "share/rc/ob_tenant_base.h"
|
||||
#include "logservice/ob_log_service.h"
|
||||
#include "storage/tablet/ob_tablet_iterator.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
using namespace oceanbase;
|
||||
using namespace common;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "share/rc/ob_tenant_base.h"
|
||||
#include "storage/ob_storage_struct.h"
|
||||
#include "storage/tablet/ob_tablet_iterator.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "rootserver/ob_recovery_ls_service.h"
|
||||
#include "rootserver/restore/ob_restore_scheduler.h"
|
||||
#include "sql/das/ob_das_id_service.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "storage/tx_storage/ob_ls_service.h"
|
||||
#include "logservice/ob_log_base_type.h"
|
||||
#include "logservice/ob_log_base_header.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "share/rc/ob_tenant_base.h"
|
||||
#include "tx/ob_trans_service.h"
|
||||
#include "access/ob_multiple_scan_merge.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "storage/tablelock/ob_table_lock_iterator.h"
|
||||
#include "storage/tablelock/ob_lock_memtable.h"
|
||||
#include "storage/tablelock/ob_obj_lock.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "logservice/ob_log_base_header.h"
|
||||
#include "storage/ls/ob_ls.h"
|
||||
#include "storage/meta_mem/ob_tablet_handle.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
using namespace oceanbase::logservice;
|
||||
using namespace oceanbase::share;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "storage/tx_storage/ob_tenant_freezer.h"
|
||||
#include "storage/tx_table/ob_tx_ctx_table.h"
|
||||
#include "storage/tx_table/ob_tx_table_define.h"
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
#define USING_LOG_PREFIX STORAGE
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "storage/tx_table/ob_tx_ctx_memtable.h"
|
||||
#include "storage/tx_table/ob_tx_table.h"
|
||||
#include <cmath>
|
||||
#include "storage/tablet/ob_tablet.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user