Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions internal/verifier/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ func (verifier *Verifier) compareDocsFromChannels(
byteCount += types.ByteCount(len(doc))

err = handleNewDoc(doc, true)

if err != nil {
err = errors.Wrapf(
err,
"comparer thread failed to handle source doc with ID %v",
doc.Lookup("_id"),
)
}
}
}

Expand All @@ -164,10 +172,22 @@ func (verifier *Verifier) compareDocsFromChannels(
}

err = handleNewDoc(doc, false)

if err != nil {
err = errors.Wrapf(
err,
"comparer thread failed to handle destination doc with ID %v",
doc.Lookup("_id"),
)
}
}
}
}

if err != nil {
return nil, 0, 0, errors.Wrap(err, "comparer thread failed")
}

// We got here because both srcChannel and dstChannel are closed,
// which means we have processed all documents with the same mapKey
// between source & destination.
Expand Down Expand Up @@ -225,7 +245,15 @@ func (verifier *Verifier) getFetcherChannels(
)

if err == nil {
err = iterateCursorToChannel(ctx, cursor, srcChannel)
err = errors.Wrap(
iterateCursorToChannel(ctx, cursor, srcChannel),
"failed to read source documents",
)
} else {
err = errors.Wrap(
err,
"failed to find source documents",
)
}

return err
Expand All @@ -241,7 +269,15 @@ func (verifier *Verifier) getFetcherChannels(
)

if err == nil {
err = iterateCursorToChannel(ctx, cursor, dstChannel)
err = errors.Wrap(
iterateCursorToChannel(ctx, cursor, dstChannel),
"failed to read destination documents",
)
} else {
err = errors.Wrap(
err,
"failed to find destination documents",
)
}

return err
Expand Down
2 changes: 1 addition & 1 deletion internal/verifier/unit_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (suite *WithMongodsTestSuite) startReplSets() {
},
}
err = directClient.Database("admin").RunCommand(ctx, command).Err()
suite.Require().NoError(err)
suite.Require().NoError(err, "should initiate replication")
}
}

Expand Down
Loading