Skip to content
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

fix(stream): Fix XPENDING serialization issue #2566

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

nathanlo-hrt
Copy link
Contributor

Currently XPENDING doesn't properly create and serialize an array of the right length: the response to an XPENDING command is always an array of length 4, regardless of the number of consumer infos it has to send back.

The existing tests pass because they all happened to have exactly one consumer.

@nathanlo-hrt nathanlo-hrt marked this pull request as ready for review September 30, 2024 21:51
PragmaTwice
PragmaTwice previously approved these changes Oct 1, 2024
@torwig
Copy link
Contributor

torwig commented Oct 1, 2024

Stream test time out after 30 minutes. Maybe there is a block or infinite wait (for example, waiting for a message that is never added).

@torwig
Copy link
Contributor

torwig commented Oct 1, 2024

@nathanlo-hrt Thank you for this catch.

@PragmaTwice
Copy link
Member

PragmaTwice commented Oct 1, 2024

Stream test time out after 30 minutes. Maybe there is a block or infinite wait (for example, waiting for a message that is never added).

So.. is this another bug of XPENDING? Or we can just change the test case to fix it?

@nathanlo-hrt
Copy link
Contributor Author

I believe this is a bug in my changes to the test code; I'll put up a fix later today. Thanks for the swift reviews!

torwig
torwig previously approved these changes Oct 1, 2024
@nathanlo-hrt
Copy link
Contributor Author

Found another issue while testing: Kvrocks currently deviates from Redis' behavior when there are no pending messages. I've added a special case for this and a test to cover the new code.

@torwig
Copy link
Contributor

torwig commented Oct 2, 2024

@nathanlo-hrt Good job! You can run ./x.py format to format the code and make the linter happy.

@torwig
Copy link
Contributor

torwig commented Oct 2, 2024

Error: unit/type/stream/stream_test.go:2170:6: ineffectual assignment to err (ineffassign)
		r, err := rdb.XAck(ctx, streamName, groupName, "0-0").Result()

Copy link
Contributor

@torwig torwig left a comment

Choose a reason for hiding this comment

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

LGTM with minor comment.

Copy link

sonarcloud bot commented Oct 4, 2024

@PragmaTwice PragmaTwice merged commit 290012e into apache:unstable Oct 4, 2024
32 checks passed
@nathanlo-hrt nathanlo-hrt deleted the xpending branch October 4, 2024 14: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.

4 participants