Skip to content

Fix: MongoDB::OpMsgCursor fail with "Batch size for getMore must be positive, but received: 0"#3998

Closed
matejk wants to merge 1 commit intopocoproject:develfrom
matejk:mongodb_op_msg_cursor_fix
Closed

Fix: MongoDB::OpMsgCursor fail with "Batch size for getMore must be positive, but received: 0"#3998
matejk wants to merge 1 commit intopocoproject:develfrom
matejk:mongodb_op_msg_cursor_fix

Conversation

@matejk
Copy link
Copy Markdown
Contributor

@matejk matejk commented Apr 4, 2023

Zero batch size for the first batch is performance optimisation to get errors fast from the server without much processing. Implementation of OpMsgCursor did not handle it properly and server responded with:

{
	"ok": 0,
	"errmsg": "Batch size for getMore must be positive, but received: 0",
	"code": 2,
	"codeName": "BadValue"
}

This pull request contains two changes:

  • Fix: MongoDB::OpMsgCursor did not handle zero batch size properly: cursor requests failed.

  • Improvement: Add emptyFirstBatch to indicate that the size of the first batch shall be zero for performance to get potential error ASAP from the server.

@aleks-f: This PR fixes new MongoDB wire protocol that was merged to branch devel, but is not yet released.

…cursor requests failed.

* Improvement: Add emptyFirstBatch to indicate that the size of the first batch shall be zero for performance to get potential error ASAP from the server.
@matejk matejk force-pushed the mongodb_op_msg_cursor_fix branch from e880853 to 5fba1be Compare April 26, 2023 10:52
@aleks-f aleks-f added this to the Release 1.13.0 milestone May 5, 2023
@aleks-f
Copy link
Copy Markdown
Member

aleks-f commented May 5, 2023

@matejk are all these contained in 971a7cc? If so, then we should just close this

@matejk
Copy link
Copy Markdown
Contributor Author

matejk commented May 6, 2023

Yes, the changes are contained there.

@matejk
Copy link
Copy Markdown
Contributor Author

matejk commented May 7, 2023

Already contained in PR #4004.

@matejk matejk closed this May 7, 2023
@matejk matejk deleted the mongodb_op_msg_cursor_fix branch May 11, 2023 10:26
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.

2 participants