Return results array for dbCommand applyOps error

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.1.0
    • Affects Version/s: None
    • Component/s: CRUD
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Run Tian Yu (Inactive)
              Reporter:
              Isabel Peters
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: