NebulaGraph标签索引重建失败求助:提示空间正在构建索引
NebulaGraph索引重建失败:提示"This space is building index"但无运行中任务
我在NebulaGraph中创建Tag索引后尝试重建,失败了。日志显示This space is building index.,但执行show jobs却看不到任何运行中的任务。
相关代码片段:
std::vector<AdminSubTask> tasks; for (auto it = env_->rebuildIndexGuard_->cbegin(); it != env_->rebuildIndexGuard_->cend(); ++it) { if (std::get<0>(it->first) == space_ && it->second != IndexState::FINISHED) { LOG(ERROR) << "This space is building index"; return cpp2::ErrorCode::E_REBUILD_INDEX_FAILED; } }
索引重建失败时的日志:
E1226 10:44:49.166803 424281 UpdateNode.h:183] vertex conflict 169:96:171:0dbb49c96ba38d8d49a9cccca0de9e28 E1226 10:44:52.144032 424285 UpdateNode.h:183] vertex conflict 169:13:171:5b09d9d36aa2d8e5d9c5e15d3c1d8245 E1226 10:47:46.856619 265937 Host.cpp:348] [Port: 9780, Space: 128, Part: 233] [Host: 172.23.236.100:9990] Failed to append logs to the host (Err: E_TERM_OUT_OF_DATE) E1226 10:49:56.923763 424242 RebuildIndexTask.cpp:63] This space is building index E1226 10:49:56.923795 424242 AdminTaskManager.cpp:254] job 183, genSubTask failed, err=E_REBUILD_INDEX_FAILED
日志中还出现大量Failed to append logs to the host (Err: E_TERM_OUT_OF_DATE)错误,以及以下顶点冲突相关日志:
E1226 11:19:29.156589 424281 UpdateNode.h:183] vertex conflict 169:21:170:13b689b5cb0c1c415849c250708e4f5e E1226 11:19:29.284868 424280 UpdateNode.h:183] vertex conflict 169:62:170:2146dc6004a8200ed3c1cca1a7ae7008 E1226 11:19:31.090054 265903 AddVerticesProcessor.cpp:164] The vertex locked : tag 170, vid 3dd7a92570f73d4c8541a6478bbecd65 E1226 11:19:32.039448 424280 UpdateNode.h:183] vertex conflict 169:13:170:1b3b3f5d0387352399feefd670b4c587 E1226 11:19:32.039489 424281 UpdateNode.h:183] vertex conflict 169:13:170:1b3b3f5d0387352399feefd670b4c587 E1226 11:19:32.143121 424282 UpdateNode.h:183] vertex conflict 169:2:170:2290a0580ffec7a1bb30d86dcd366571
问题分析与解决步骤
1. 清理残留的索引重建锁
从代码逻辑看,rebuildIndexGuard_中存在未标记为FINISHED的任务记录,导致新的重建请求被拦截,但show jobs无法检测到。
- 在NebulaGraph控制台执行命令强制清理锁:
替换ADMIN CLEAR REBUILD INDEX LOCK <space-name>;<space-name>为对应空间名称。
2. 修复集群一致性问题(E_TERM_OUT_OF_DATE)
该错误说明集群节点日志不一致,影响任务执行:
- 执行
SHOW HOSTS检查所有Storage节点状态,确保Status为ONLINE; - 检查节点网络连通性,重启异常或日志落后过多的Storage节点;
- 确认所有节点的raft日志同步正常。
3. 处理顶点冲突问题
日志中的顶点冲突是因为重建期间有业务写入操作抢占锁:
- 暂时暂停业务写入,待索引重建完成后恢复;
- 若无法暂停写入,调整Graphd配置文件
nebula-graphd.conf中的rebuild_index_concurrent参数为较小值(如2),重启Graphd服务降低并发冲突概率。
4. 重新尝试索引重建
完成上述操作后,执行命令重建索引:
REBUILD TAG INDEX <index-name>;
用SHOW JOBS监控任务状态,确认是否正常执行。
内容的提问来源于stack exchange,提问作者黄凤仙
相关产品推荐
相关产品推荐

