shardingェ…

shardingしてるcollectionのshardingを解除する方法がdropしかないみたいなのでやむを得ず試してみました。


drop前はdb.printShardingStatus()で表示されます。

> db.printShardingStatus()
(略)
                test2.table01 chunks:
                                set01   1
                        { "name" : { $minKey : 1 } } -->> { "name" : { $maxKey : 1 } } on : set01 { "t" : 1000, "i" : 0 }


dropしてみます。

> db.table01.drop()
true

db.printShardingStatus()でも表示されなくなりました。


よしおっけー問題なしと思ってこの作業の前にやってたテストデータのsaveをforで回しつつchunkの状態を確認してたら何故かshardingが上手くいってない。
mongosのログを確認してみます。

Mon May 16 22:19:43 [conn1] warning: could have autosplit on collection: test2.table02 but: splitVector command failed: { errmsg: "exception: [test2.table02] shard version not ok in Client::Conte...", code: 13388, ok: 0.0 }

なんぞ…。
なんかshardのバージョンおかしいぞコラと怒られてます。


insertされたshardのログも見てみる。

Mon May 16 22:19:43 [conn101] Assertion: 13388:[test2.table02] shard version not ok in Client::Context: client in sharded mode, but doesn't have version set for this collection: test2.table02 myVersion: 25|1

後半省略されてないのが表示されました。


その後もとりあえずテストデータをぶちこみ続けましたが、変動があるはずのchunksの値が全然変わらない。
それでも性懲りずにぶち込み続けたところ、急にchunksの値が変わり、migrationが始まりました。
何がトリガーになってるんだろう…。

スポンサーリンク