Skip to content

Conversation

@justonedev1
Copy link
Collaborator

  • added key to messages containing environment id or run number
  • changed Balancer from LeastBytes to Hash which makes kafka-go puts messages with same key to the same partition, fixing ordering problems

I did not add any tests, because I was unsure how to test this properly, so I just tested this on my openstack machine.

@justonedev1 justonedev1 requested a review from knopers8 February 25, 2025 16:49
Comment on lines 162 to 165
case *pb.Ev_RunEvent:
// we are using RunNumber as a key here, requested by M.Boulais
key = make([]byte, 4)
binary.BigEndian.PutUint32(key, e.RunNumber)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do i correctly understand that the consequence of this is that we will not have synchronization between RunEvents and all the others, as they use different keys? What is the advantage of using run number here, if env ID should be anyway available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that is the reason for the comment. Martin wanted to use run number for this event in ticket, so I used it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

by the way, RunEvents are in their own topic

Copy link
Collaborator

Choose a reason for hiding this comment

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

as discussed in person, please cross-check with Martin what is the reason for this exception just to be sure, but I'm OK with this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed in person: Martin is on vacation this week, I sent him a message. I will report when he is back.

Copy link
Collaborator

Choose a reason for hiding this comment

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

we are not releasing this week, so it's anyway fine to wait.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Martin agreed that using envId is fine here. So I did amend previous commit and reworded it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thank you!

@justonedev1 justonedev1 requested a review from knopers8 February 26, 2025 08:58
@justonedev1 justonedev1 changed the title QC-985 Place kafka messages related to same environments in the same partition OCTRL-985 Place kafka messages related to same environments in the same partition Feb 26, 2025
@justonedev1 justonedev1 changed the title OCTRL-985 Place kafka messages related to same environments in the same partition [OCTRL-985] Place kafka messages related to same environments in the same partition Feb 26, 2025
- added environment id as a key to messages containing environment id
field
- changed Balancer from LeastBytes to Hash which makes kafka-go puts
messages with same key to the same partition, fixing ordering problems
@knopers8 knopers8 merged commit 3a5ee34 into master Mar 3, 2025
2 checks passed
@knopers8 knopers8 deleted the OCTRL-985 branch March 3, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants