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

Improve the error message when fail to create a super stream #10535

Closed
Gsantomaggio opened this issue Feb 12, 2024 · 0 comments
Closed

Improve the error message when fail to create a super stream #10535

Gsantomaggio opened this issue Feb 12, 2024 · 0 comments
Assignees
Milestone

Comments

@Gsantomaggio
Copy link
Member

Describe the bug

by protocol, I could create a super stream with the same partitions name:

  const string SuperStream = "my_super_stream_with_2_partitions";
  var partitions = new List<string> { "partition_0", "partition_0" }; //// <---- partition names are equals 
  var bindingKeys = new List<string>() { "0", "1" };
  var args = new Dictionary<string, string> { { "queue-leader-locator", "least-leaders"},
                { "max-length-bytes", "10000"}, {"max-age", "30000s"}};
  var response = await client.CreateSuperStream(SuperStream, partitions, bindingKeys, args);
  Assert.Equal(ResponseCode.Ok, response.ResponseCode);

In this case, the server error side is :

2024-02-12 10:16:51.981857+00:00 [warning] <0.970.0> Error while trying to create super stream <<"my_super_stream_with_2_partitions">>: reference_already_exists

That is not correct since my_super_stream_with_2_partitions does not exist.

Do you think we can improve the server-side log with something like the following:

 <0.970.0> Error while trying to create super stream <<"my_super_stream_with_2_partitions">> the partition `partition_0` _already_exists

The error sent back is internalError, which seems scary.

I would send a precondition failure

Reproduction steps

Create a super stream with two partitions with the same name.

Expected behavior

Change the server-side log.
Change the error returned to precondition failure

Additional context

No response

@michaelklishin michaelklishin changed the title [SuperStream] Improve the error message when fail to create a super stream Improve the error message when fail to create a super stream Feb 12, 2024
@ikavgo ikavgo self-assigned this Feb 13, 2024
@michaelklishin michaelklishin added this to the 3.13.1 milestone Mar 11, 2024
michaelklishin added a commit that referenced this issue Mar 11, 2024
…artition-name-error

FIX #10535. Super Streams: check for duplicate partitions names
mergify bot pushed a commit that referenced this issue Mar 11, 2024
michaelklishin added a commit that referenced this issue Mar 11, 2024
FIX #10535. Super Streams: check for duplicate partitions names (backport #10712)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants