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

topic-manager improvements #297

Merged
merged 2 commits into from
Feb 10, 2021
Merged

topic-manager improvements #297

merged 2 commits into from
Feb 10, 2021

Conversation

frairon
Copy link
Contributor

@frairon frairon commented Jan 21, 2021

This PR fixes two main issues:

  • when checking if a topic exists and the cluster was configured with auto.create.topics.enable=true, the topic would be auto-created with default-configuration. This messes up table-creation because those topics would not be log-compacted which is required by goka. The new version does not trigger auto-creation when checking for a topic.
  • if the topic configuration does not match, the topic manager can be configured to
    • print a warning
    • fail
    • ignore (that was the default before)
      The topic manager does not attempt to modify misconfigured topics, as this could be dangerous for intentional configuration changes via other kafka tools outside of goka.

@frairon frairon force-pushed the improve-topicmanager-creation branch from c241acc to 09b1e04 Compare January 21, 2021 14:54
fixed flaky tests by not resetting mockconsumergroup on close (not reused anyway)
small fix to append to slices in GroupGraph
@frairon frairon force-pushed the improve-topicmanager-creation branch from 09b1e04 to efeaf69 Compare January 24, 2021 21:00
@frairon frairon force-pushed the improve-topicmanager-creation branch from 19af87f to b8d08be Compare February 1, 2021 05:42
@frairon frairon requested a review from jomaresch February 1, 2021 05:50
jomaresch
jomaresch previously approved these changes Feb 1, 2021
Copy link
Contributor

@jomaresch jomaresch left a comment

Choose a reason for hiding this comment

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

LGTM

R053NR07
R053NR07 previously approved these changes Feb 1, 2021
Copy link

@R053NR07 R053NR07 left a comment

Choose a reason for hiding this comment

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

Think this looks good.

Copy link

@R053NR07 R053NR07 left a comment

Choose a reason for hiding this comment

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

LGTM

@frairon frairon merged commit f804627 into master Feb 10, 2021
@frairon frairon deleted the improve-topicmanager-creation branch February 10, 2021 19:09
@vladlepbeat
Copy link

Hi @frairon,
We updated to goka 1.0.6 recently and noticed this is a breaking change for us when spinning up testing environments. To explain a bit the use case, we use goka for a data pipeline and all the data we collect is deleted after 15 minutes. Although in goka compaction should be used, in our case it is actually not needed as everything is removed in 15 minutes. In those 15 mins compaction would not kick in anyways. We have testing environments that we can spin up with their own kafka cluster when needed. For these we have auto.create.topics.enable=true and in the past topics where created and all was working ok for us.

To fix the issue, we now downgraded to an older version but wanted to ask if we could have this configurable?

@jomaresch
Copy link
Contributor

@vladlepbeat
As far as I know you can call EnsureStreamExists() on every startup for each topic you need.

Here is an example:

err = tm.EnsureStreamExists(string(topic), 8)
if err != nil {
log.Printf("Error creating kafka topic %s: %v", topic, err)
}

@vladlepbeat
Copy link

Hi @jomaresch
I tried now your proposal and it seems to do exactly what we need.
Thank you for the answer.

@jomaresch
Copy link
Contributor

Nice.
Your are welcome 🙂

@frairon
Copy link
Contributor Author

frairon commented Sep 13, 2021

@vladlepbeat the thing with automatic topic creation was, that it was actually a bug in goka. We used the wrong API call so to say, which made clusters configured with auto-create create the topics also for tables. Then we ended up with table topics configured as streams (no compaction), which completely messes up the state in the views.
There was a similar discussion going on in issue #323 (which isn't solved yet).
If remembering correctly the bottom line is, that we want to implement a hybrid approach that makes goka manage the topics it owns (like tables, loops and output topics) and let the cluster decide for the other topics. So there's still a bit of work needed here. But Johannes' suggestion is the perfect workaround so far.

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.

5 participants