Unverified Commit ad4645fc authored by groot's avatar groot Committed by GitHub
Browse files

check task table limit (#1902)



Signed-off-by: default avatargroot <yihua.mo@zilliz.com>
parent b04b3e94
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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;