[GODRIVER-832] Return results array for dbCommand applyOps error Created: 14/Feb/19  Updated: 28/Oct/23  Resolved: 22/Jul/19

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: None
Fix Version/s: 1.1.0

Type: Improvement Priority: Major - P3
Reporter: Isabel Peters Assignee: Run Tian Yu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

When running the dbCommand to applyOps to a mongod a results array (boolean) is returned when the command was successful or unsuccessful (indicating each op was applied successfully or failed to apply).
For instance, if the array of oplogs contains two oplogs that can be applied successfully and one that fails we can see on the command line:

{
	"applied" : 3,
	"code" : 26,
	"codeName" : "NamespaceNotFound",
	"errmsg" : "cannot apply insert or update operation on a non-existent namespace test.coll2: { ts: Timestamp(1505846037, 1), t: 1, h: 216366330843306159, v: 2.0, op: \"i\", ns: \"test.coll2\", o: { _id: ObjectId('5c6566aa482223d45f59ab10'), key: \"v3\" } }",
	"results" : [
		true,
		true,
		false
	],
	"ok" : 0
}

The go driver currently returns the errmsg but there is no way to access the results array that would indicate that the first two oplogs applied successfully and the third failed.

(If all oplogs apply successfully the results array is actually returned in the result object.)

Backup needs to know the oplogs that were successfully applied in order to implement a safe retry logic for our PIT implementations.



 Comments   
Comment by Githook User [ 06/Aug/19 ]

Author:

{'name': 'Connie Yu', 'username': 'connieyu', 'email': 'connie.yu@10gen.com'}

Message: Return results from runCommand in error cases

GODRIVER-832

Change-Id: I5dc892d7cab5e3d8cf03dc3acda3bc77787a0a90
Branch: fle
https://github.com/mongodb/mongo-go-driver/commit/023c3eb4ff8898a2f624f49f58208b79fe468a39

Comment by Githook User [ 22/Jul/19 ]

Author:

{'name': 'Connie Yu', 'username': 'connieyu', 'email': 'connie.yu@10gen.com'}

Message: Return results from runCommand in error cases

GODRIVER-832

Change-Id: I5dc892d7cab5e3d8cf03dc3acda3bc77787a0a90
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/023c3eb4ff8898a2f624f49f58208b79fe468a39

Comment by Isabel Peters [ 04/Mar/19 ]

We will need this feature for the new PIT agent which is currently scheduled for release v20190415. 

CC: chunming.li

Generated at Thu Feb 08 08:35:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.