diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index 15d60e6c96fbdcb4288c43343e981e46566caeb3..f7102c006189ec797b35fd027f94ffb6d42dfeee 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -1108,7 +1108,7 @@ DBImpl::ExecWalRecord(const wal::MXLogRecord& record) { switch (record.type) { case wal::MXLogType::Entity: { int64_t collection_name = 0, partition_id = 0; - auto status = get_collection_partition_id(record, collection_name, partition_id); + status = get_collection_partition_id(record, collection_name, partition_id); if (!status.ok()) { LOG_WAL_ERROR_ << LogOut("[%s][%ld] ", "insert", 0) << status.message(); return status; @@ -1124,7 +1124,7 @@ DBImpl::ExecWalRecord(const wal::MXLogRecord& record) { case wal::MXLogType::Delete: { snapshot::ScopedSnapshotT ss; - auto status = snapshot::Snapshots::GetInstance().GetSnapshot(ss, record.collection_id); + status = snapshot::Snapshots::GetInstance().GetSnapshot(ss, record.collection_id); if (!status.ok()) { LOG_WAL_ERROR_ << LogOut("[%s][%ld] ", "delete", 0) << "Get snapshot fail: " << status.message(); return status; @@ -1148,7 +1148,7 @@ DBImpl::ExecWalRecord(const wal::MXLogRecord& record) { if (!record.collection_id.empty()) { // flush one collection snapshot::ScopedSnapshotT ss; - auto status = snapshot::Snapshots::GetInstance().GetSnapshot(ss, record.collection_id); + status = snapshot::Snapshots::GetInstance().GetSnapshot(ss, record.collection_id); if (!status.ok()) { LOG_WAL_ERROR_ << LogOut("[%s][%ld] ", "flush", 0) << "Get snapshot fail: " << status.message(); return status; @@ -1175,7 +1175,7 @@ DBImpl::ExecWalRecord(const wal::MXLogRecord& record) { std::set flushed_collections; for (auto id : collection_names) { snapshot::ScopedSnapshotT ss; - auto status = snapshot::Snapshots::GetInstance().GetSnapshot(ss, id); + status = snapshot::Snapshots::GetInstance().GetSnapshot(ss, id); if (!status.ok()) { LOG_WAL_ERROR_ << LogOut("[%s][%ld] ", "flush", 0) << "Get snapshot fail: " << status.message(); return status; @@ -1239,7 +1239,7 @@ DBImpl::BackgroundMerge(std::set collection_names, bool force_merge merge_mgr_ptr_->UseStrategy(MergeStrategyType::ADAPTIVE); } - auto status = merge_mgr_ptr_->MergeFiles(collection_name); + status = merge_mgr_ptr_->MergeFiles(collection_name); merge_mgr_ptr_->UseStrategy(old_strategy); if (!status.ok()) { LOG_ENGINE_ERROR_ << "Failed to get merge files for collection: " << collection_name diff --git a/core/src/segment/SegmentReader.cpp b/core/src/segment/SegmentReader.cpp index 7b84d4d3f893df2c67e8c105676c7f168ac4dd60..ca04c56edb482fae84776343a8e166d01c2e7a92 100644 --- a/core/src/segment/SegmentReader.cpp +++ b/core/src/segment/SegmentReader.cpp @@ -164,7 +164,7 @@ SegmentReader::LoadEntities(const std::string& field_name, const std::vectorRead(fs_ptr_, file_path, ranges, raw); diff --git a/core/src/server/grpc_impl/GrpcRequestHandler.cpp b/core/src/server/grpc_impl/GrpcRequestHandler.cpp index 2367758e7b789c082f237004fedfcf42b68af118..52873f5b3f3af9f51cf1335f53ba336b519b5ba4 100644 --- a/core/src/server/grpc_impl/GrpcRequestHandler.cpp +++ b/core/src/server/grpc_impl/GrpcRequestHandler.cpp @@ -1255,6 +1255,11 @@ GrpcRequestHandler::Insert(::grpc::ServerContext* context, const ::milvus::grpc: auto valid_row_count = [&](int32_t& base, int32_t test) -> bool { if (base < 0) { base = test; + if (request->entity_id_array_size() > 0 && base != request->entity_id_array_size()) { + auto status = Status{SERVER_INVALID_ROWRECORD_ARRAY, "ID size not matches entity size"}; + SET_RESPONSE(response->mutable_status(), status, context); + return false; + } } else if (base != test) { auto status = Status{SERVER_INVALID_ROWRECORD_ARRAY, "Field row count inconsist"}; SET_RESPONSE(response->mutable_status(), status, context);