Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 直写表配置了向量索引却没写入对应向量字段的时候引擎会反复重新加载 #222

Open
dyuyang opened this issue Dec 8, 2023 · 1 comment

Comments

@dyuyang
Copy link
Collaborator

dyuyang commented Dec 8, 2023

No description provided.

@dyuyang dyuyang changed the title [BUG] 直写表配置了向量索引却没写入对应向量字段的时候引擎会core [BUG] 直写表配置了向量索引却没写入对应向量字段的时候引擎会反复重新加载 Dec 10, 2023
@dyuyang
Copy link
Collaborator Author

dyuyang commented Dec 10, 2023

  1. 当aitheta发现用户插入的向量数据格式不正确或者缺字段,且schema里面没有配置ignore_invalid_doc=true时,首先会抛出错误
    Status AithetaMemIndexer::AddDocument(indexlib::document::IndexDocument* indexDoc)
    {
    IndexFields fieldData;
    IndexFieldParser::ParseStatus parseStatus = _fieldParser->Parse(indexDoc, fieldData);
    Status status = Status::OK();
    if (IndexFieldParser::ParseStatus::PS_OK == parseStatus) {
    if (!_segmentBuilder->Build(fieldData)) {
    status = Status::InternalError("build document failed");
    }
    } else if (IndexFieldParser::ParseStatus::PS_FAIL == parseStatus) {
    status = Status::InternalError("parse document fields failed");
    }
    if (status.IsOK()) {
    _docCount++;
    } else if (_aithetaIndexConfig.buildConfig.ignoreInvalidDoc) {
    _invalidDocCount++;
    status = Status::OK();
    }
    return status;
  2. 然后引发直写表停止构建,不能再commit
    if (builder->hasFatalError()) {
    AUTIL_LOG(WARN, "%s: fatal error happens, stop build and reload", _pid.ShortDebugString().c_str());
    _needReload = true;

std::pair<bool, TableVersion> DirectBuilder::commit() {
AUTIL_LOG(INFO, "%s begin commit", _pid.ShortDebugString().c_str());
if (_needReload) {
return {false, TableVersion()};

  1. 进而引发直写表管理类释放当前searcher的leader地位

    } else if (!result.first) {
    AUTIL_LOG(WARN, "partition[%s] commit version failed, release leader", FastToJsonString(pid, true).c_str());
    _leaderElectionMgr->releaseLeader(pid);
    }

  2. 可以从suez中的状态机看到,无论之前是什么状态,一旦触发放弃leader事件,都会引发searcher的对应事件

    // no longer leader
    _stateMachine.add(TS_UNKNOWN, LT_NO_LONGER_LEADER, OP_INIT);
    _stateMachine.add(TS_UNLOADED, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_LOADED, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_FORCE_RELOAD, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_PRELOAD_FAILED, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_PRELOAD_FORCE_RELOAD, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_ERROR_LACK_MEM, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_ERROR_CONFIG, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_ERROR_UNKNOWN, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);
    _stateMachine.add(TS_COMMIT_ERROR, LT_NO_LONGER_LEADER, OP_NO_LONGER_LEADER);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant