Skip to content

CDRIVER-4539 wait for unacknowledged writes to apply in test_bulk_reply_w0 #1170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 22, 2022

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Dec 20, 2022

Summary

This PR intends to resolve test failures observed in /BulkOperation/multiple_errors.

  • wait for unacknowledged writes to apply in test_bulk_reply_w0
  • set appName in failpoint for test_bulk_write_multiple_errors.

Background & Motivation

The /BulkOperation/multiple_errors test was recently added. It infrequently fails with an error matching the expected errorReplies. See CDRIVER-4539 for a sample test output.

test_bulk_write_multiple_errors sets a failpoint and expects the insert and delete commands to fail.

This patch build with command monitoring enabled reproduced the test failure. It shows that the delete unexpectedly succeeds.

command configureFailPoint started [...]
command configureFailPoint succeeded [...]
command insert started [...]
command insert failed [...]
command delete started [...]
command delete succeeded [...] <-- UNEXPECTED. EXPECTED failed.

Inspecting the mongod logs show that the delete command from the prior test_bulk_reply_w0 is triggering the failpoint:

{"t":{"$date":"2022-12-20T21:25:44.278+00:00"},"s":"D1", "c":"COMMAND",  "id":21962,   "ctx":"conn394","msg":"Assertion while executing command","attr":{"command":"insert","db":"test","commandArgs":{"insert":"test_bulk_write_multiple_errors_1574510557_25208","ordered":false,"$db":"test","$clusterTime":{"clusterTime":{"$timestamp":{"t":1671571544,"i":6}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}}},"error":"UnknownError: Failing command via 'failCommand' failpoint"}}
[...]
{"t":{"$date":"2022-12-20T21:25:44.280+00:00"},"s":"D1", "c":"COMMAND",  "id":21962,   "ctx":"conn388","msg":"Assertion while executing command","attr":{"command":"delete","db":"test","commandArgs":{"delete":"test_insert_w0_1574490982_25208","ordered":true,"$db":"test","$clusterTime":{"clusterTime":{"$timestamp":{"t":1671571544,"i":5}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"writeConcern":{"w":0}},"error":"UnknownError: Failing command via 'failCommand' failpoint"}}

@kevinAlbs kevinAlbs changed the title CDRIVER-4539 log command monitoring events on test failure CDRIVER-4539 wait for unacknowledged writes to apply in test_bulk_reply_w0 Dec 21, 2022
@kevinAlbs kevinAlbs marked this pull request as ready for review December 21, 2022 19:15
Copy link
Contributor

@vector-of-bool vector-of-bool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Is this a server bug? I would expect the failpoint to be applied only to commands received after the failpoint-enable arrives.

@kevinAlbs
Copy link
Collaborator Author

LGTM.

Is this a server bug? I would expect the failpoint to be applied only to commands received after the failpoint-enable arrives.

No. Though the failCommand failpoint has an optional appName argument that can be used to isolate the failpoint:

appName: the appName which clients must specify in order to be affected by the failpoint. Clients without an appName or with a different appName will not trigger the failpoint. New in MongoDB 4.2.9

Added 8cca089 to also configure appName to isolate the failpoint.

@kevinAlbs kevinAlbs merged commit 9b391f8 into mongodb:master Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants