mongodb – run cleanup Orphaned in a loop Do not remove all orphaned documents from the shard

MongoDB v3.4.1, Run cleanupOrphaned in a loop. Do not remove all orphaned documents from the shard. There is a problem?

1. Use Mongoshake Migrate Mongo Sharding, there is a double mistake. The key is _id ObjectId (& # 39; 59c000000cf2886b58b6c081 & # 39;).

Second
db.table.find ({# # id; #: ObjectId (# 59c000000cf2886b58b6c081 #)}). count ()
Result is 2

3. Find which shard this document has

while the line is being read
do
echo $ line
/ bin / mongo $ line / db << EOF
use db
db.table.find ({# # id; #: ObjectId (# 59c000000cf2886b58b6c081 #)}). count ()
EOF
done

=> there are shard1 and shard5

4. Run cleanupOrphaned in a loop in shard1 and shard5

use admin

var nextKey = {};
var result;

while (nextKey! = null) {
result = db.adminCommand ({cleanupOrphaned: "db.table", startingFromKey: nextKey});

if (result.ok! = 1)
print ("The process can not be completed at this time: error or timeout.")

printjson (result);

nextKey = result.stoppedAtKey;
}
5th
db.table.find ({# # id; #: ObjectId (# 59c000000cf2886b58b6c081 #)}). count ()
Result is 2

Why can not a validator in Shard "A" in Shard "B" verify the accuracy of historical transactions?

This question is about splitting blockchains. A method for scaling transaction throughput.

In this article about the fragmentary block chains (link to the article) we read:

The core idea in Blockchains is that most of the participants
Operation or use of the network can not validate blocks in all
Shards. As such, whenever a participant needs to interact with a
special shard them in general can not download and validate the
entire history of the shard.

What is the reason an examiner in Shard A has this? can not download and validate the correctness of the entire history of the shard B?

In my view, this validator can download all historical transactions in any Shard (just like a non-split blockchain) and then check the history of all transactions by tracking every transaction.

What is the problem? (In general, all shards use the same consensus algorithms and all have the same block structure.)

To update: To answer the commentary, here are some examples of the broken-glass block chains:

(1) https://www.comp.nus.edu.sg/~prateeks/papers/Elastico.pdf

(2) https://infoscience.epfl.ch/record/255586/files/OmniLedger.pdf

(3) Ethereum sharding faq. "(2017). Https://github.com/ethereum/wiki/wiki/Sharding-FAQ

(4) https://docs.zilliqa.com/whitepaper.pdf

(5) https://eprint.iacr.org/2018/460.pdf

(6) https://icoguru.io/uploads/icos/harmonypaper.pdf

Mongodb – Shard key specification

I have such a document:

{
"_id": ObjectId ("52f29f91ddbd75540aba6dae"),
"Team": [
        {
            "name" : "Washington Bullets",
            "score" : 100,
            "home" : false,
            "won" : 1,
            "players" : [
                {
                    "player" : "Jeff Ruland",
                    "pts" : 19
                },
                {
                    "player" : "Cliff Robinson",
                    "pts" : 22
                },
                {
                    "player" : "Gus Williams",
                    "pts" : 21
                },
                {
                    "player" : "Jeff Malone",
                    "pts" : 18
                },
                {
                    "player" : "Charles Jones",
                    "pts" : 4
                },
                {
                    "player" : "Dan Roundfield",
                    "pts" : 2
                },
                {
                    "player" : "Perry Moss",
                    "pts" : 7
                },
                {
                    "player" : "Dudley Bradley",
                    "pts" : 0
                },
                {
                    "player" : "Darren Daye",
                    "pts" : 5
                },
                {
                    "player" : "Tom McMillen",
                    "pts" : 2
                },
                {
                    "player" : "Manute Bol",
                    "pts" : 0
                }
            ]
        },
{
"name": "Atlanta Hawks",
"Score": 91,
"home": true,
"won": 0,
"Player": [
                {
                    "player" : "Dominique Wilkins",
                    "pts" : 32
                },
                {
                    "player" : "Tree Rollins",
                    "pts" : 9
                },
                {
                    "player" : "Cliff Levingston",
                    "pts" : 8
                },
                {
                    "player" : "Spud Webb",
                    "pts" : 12
                },
                {
                    "player" : "Kevin Willis",
                    "pts" : 13
                },
                {
                    "player" : "Randy Wittman",
                    "pts" : 6
                },
                {
                    "player" : "Scott Hastings",
                    "pts" : 4
                },
                {
                    "player" : "Lorenzo Charles",
                    "pts" : 4
                },
                {
                    "player" : "Sedric Toney",
                    "pts" : 0
                },
                {
                    "player" : "Ray Williams",
                    "pts" : 0
                },
                {
                    "player" : "Jon Koncak",
                    "pts" : 3
                }
            ]
        }
]}

I want to disconnect from teams.name. I tried to do:

sh.shardCollection ("finalNBA.list", {teams: {name: 1}})

But I get the error that the shard key is only 1 or hash. Does anyone know how to enable sharding using an embedded field?

Delete the Oracle database shard status

Had problems with the configuration of the Oracle Sharding infrastructure. In particular, a shard was inserted in the wrong shard area. Removed it (probably to move the chunks first) -Makes Option and tried to add again. Since then, the shard has been added in the wrong state and I have not found a way to fix it.

Just for info:

GDSCTL> Configuration Shard
Name Shard Group Status Status Region Availability
---- ----------- ------ ----- ---------- --------
ape002 shrdgrp_oper Ok Replicates reg_oper PENDING
ape003 shrdgrp_arch Ok Replicates reg_arch PENDING

Now you have deleted the three DBs (two shards and the Shard catalog), recreated them and restarted the configuration process.

The question: How can you delete all sharding-related information from a database without having to recreate it?