Failed to add new value partitions to database

我的集群环境是3台linux_x64服务器,DolphinDB v2.0.1, 1个控制节点3个节点。

dfsReplicationFactor=2
dataSync=1

创建的数据库schema如下:

2021.09.09 08:42:57.180: execution was completed [34ms]
partitionSchema->[2021.09.06,2021.09.05,2021.09.04,2021.09.03,2021.09.02,2021.09.01,2021.08.31,2021.08.30,...]
databaseDir->dfs://dwd
engineType->OLAP
partitionSites->

partitionTypeName->VALUE

partitionType->1

今天我在往数据库dfs://dwd写入数据时报错如下:

Failed to add new value partitions to database dfs://dwd.Please manaually add new partitions [2021.09.07].

然后我用下列脚本手工添加分区:

db=database("dfs://dwd")
addValuePartitions(db,2021.09.07..2021.09.09)

报错:

<ChunkInRecovery>openChunks failed on '/dwd/domain', chunk cf57375e-b4b3-dc87-9b41-667a5e91a757 is in RECOVERING state




请先 登录 后评论

1 个回答

wale

修复方法如下:

第1步,用getClusterChunksStatus在控制节点上得到 `/dwd/domain'的chunkid,示例代码如下:

select * from rpc(getControllerAlias(), getClusterChunksStatus) where  file like "%/domain%" and state != 'COMPLETE'

attachments-2021-09-7PqFKwTl61396126c2ea0.png

第2步,用getAllChunks得到该chunkid在数据节点的分区信息,下面代码中chunkid为第1步执行结果得到的"4503a64f-4f5f-eea4-4247-a0d0fc3941a1"。

select * from pnodeRun(getAllChunks)  where chunkId="4503a64f-4f5f-eea4-4247-a0d0fc3941a1"


attachments-2021-09-CjQpWqjF6139610eccbcc.png

第3步,用copyReplicas复制分区副本,假设第2步的结果显示分区副本在datanode3上,现在往datanode1上复制一份:

rpc(getControllerAlias(), copyReplicas{`datanode3, `datanode1, "4503a64f-4f5f-eea4-4247-a0d0fc3941a1"})

第4步,用getClusterChunksStatus验证分区状态已为COMPLETE,说明修复成功。

attachments-2021-09-tGWQCS0Y613963048d2e7.png



请先 登录 后评论
  • 1 关注
  • 0 收藏,1305 浏览
  • Alex 提出于 2021-09-09 08:43

相似问题