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 known issues in group client #428

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

akrambek
Copy link
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

sasl);
newStream = newGroup::onApplication;

groupStreams.put(groupId, newGroup);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can simplify this nested if.

if (group == null || HIGHLANDER_PROTOCOL.equals(protocol))
{
    if (group != null)
    {
        // migrate group stream
    }
    else
    {
        // create group stream
    }
}

seems like it can simplify to

if (group == null)
{
     // create group stream
}
else if (HIGHLANDER_PROTOCOL.equals(protocol))
{
    // migrate group stream
}

agree?

@@ -1372,9 +1376,15 @@ private void onApplicationBegin(
topicMetadataLimit += metadataSize;
}

initiateStream();

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a no-op since state is not closed so can be removed, agree?

{
stream.streamCleanup(traceId, traceId);
group.streamTakeover(traceId, traceId, application, originId, routedId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest changing to onApplicationMigrate(BeginFW, application).

Also, second parameter is authorization, not traceId, but that will get sorted out implicitly by above refactor.

initialAck = 0;
replyAck = 0;
replySeq = 0;
state = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove separate method and inline code at call-site (only one left after removal from onApplicationBegin).


private int generationId;
private int nextJoinGroupRequestId;
private int nextJoinGroupResponseId;
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are just detecting a request in flight, then is it necessary to track join-group requests separately, or does it still work if we just track generic requests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No that's what we discussed and it was your suggestion :) we had to track the join group requests separately

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, just confirming it is still necessary after the other changes we included. 😄

@jfallows jfallows merged commit d395bb9 into aklivity:feature/mqtt-kafka Sep 19, 2023
3 checks passed
@akrambek akrambek deleted the bug/group-sync branch September 28, 2023 19:18
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