|
Adding the reason to the DDL coordinator's release log message, the result is:
"msg":"Releasing sharding DDL coordinator",
|
"attr":{
|
"coordinatorId":{
|
"namespace":"test_db",
|
"operationType":"movePrimary"
|
},
|
"reason":"NamespaceExists: unsharded collection with same namespace test_db.test_coll_1 already exists."
|
}
|
The reported information is enough for troubleshooting, since (1) for each namespace it is not possible to have concurrent operations and (2) for each of them it is now possible to determine the operation result. This implies that the customer log messages implemented at the level of coordinator are now redundant and can be removed. Ideally, we can also report the name of the failed phase. An example of existing custom log message is:
"msg":"Failed movePrimary operation",
|
"attr":{
|
"db":"test_db",
|
"to":"move_primary_basic-rs1",
|
"phase":"clone",
|
"error":"NamespaceExists: unsharded collection with same namespace test_db.test_coll_1 already exists."
|
}
|
The same cannot be said for the operation start messages, as they report specific information of the operation (e.g., the destination shard for the movePrimary operation). An example follows:
"msg":"Running movePrimary operation",
|
"attr":{
|
"db":"test_db",
|
"to":"move_primary_basic-rs1"
|
}
|
|