未验证 提交 ad4645fc 编写于 作者: G groot 提交者: GitHub

check task table limit (#1902)

Signed-off-by: Ngroot <yihua.mo@zilliz.com>
上级 b04b3e94
......@@ -36,6 +36,7 @@
#include "meta/MetaFactory.h"
#include "meta/SqliteMetaImpl.h"
#include "metrics/Metrics.h"
#include "scheduler/Definition.h"
#include "scheduler/SchedInst.h"
#include "scheduler/job/BuildIndexJob.h"
#include "scheduler/job/DeleteJob.h"
......@@ -1214,6 +1215,13 @@ DBImpl::QueryAsync(const std::shared_ptr<server::Context>& context, const meta::
milvus::server::ContextChild tracer(context, "Query Async");
server::CollectQueryMetrics metrics(vectors.vector_count_);
if (files.size() > milvus::scheduler::TASK_TABLE_MAX_COUNT) {
std::string msg =
"Search files count exceed scheduler limit: " + std::to_string(milvus::scheduler::TASK_TABLE_MAX_COUNT);
ENGINE_LOG_ERROR << msg;
return Status(DB_ERROR, msg);
}
TimeRecorder rc("");
// step 1: construct search job
......
......@@ -8,6 +8,7 @@
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.
#pragma once
#include <condition_variable>
#include <deque>
......@@ -35,5 +36,7 @@ using EngineFactory = engine::EngineFactory;
using EngineType = engine::EngineType;
using MetricType = engine::MetricType;
constexpr uint64_t TASK_TABLE_MAX_COUNT = 1ULL << 16ULL;
} // namespace scheduler
} // namespace milvus
......@@ -97,7 +97,7 @@ struct TaskTableItem : public interface::dumpable {
class TaskTable : public interface::dumpable {
public:
TaskTable() : table_(1ULL << 16ULL) {
TaskTable() : table_(TASK_TABLE_MAX_COUNT) {
}
TaskTable(const TaskTable&) = delete;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册