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 e2e producer #268

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions e2e/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,6 @@ func (s *Service) Start(ctx context.Context) error {
return fmt.Errorf("could not validate end-to-end topic: %w", err)
}

// Get up-to-date metadata and inform our custom partitioner about the partition count
topicMetadata, err := s.getTopicMetadata(ctx)
if err != nil {
return fmt.Errorf("could not get topic metadata after validation: %w", err)
}
partitions := len(topicMetadata.Topics[0].Partitions)
Copy link
Contributor Author

@bachmanity1 bachmanity1 Jul 26, 2024

Choose a reason for hiding this comment

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

even if the err above is nil the topicMetadata.Topics[0].ErrorCode is not guaranteed to be zero.

s.partitionCount = partitions

// finally start everything else (producing, consuming, continuous validation, consumer group tracking)
go s.startReconciliation(ctx)

Expand Down
4 changes: 4 additions & 0 deletions e2e/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func (s *Service) validateManagementTopic(ctx context.Context) error {
return fmt.Errorf("failed to create partitions: %w", err)
}

// after topic configuration is complete number of partitions must be equal to the number of brokers multiplied
// by the partitions per broker
s.partitionCount = len(meta.Brokers) * s.config.TopicManagement.PartitionsPerBroker

return nil
}

Expand Down