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

Feature: apply changes following plan order #37

Open
gquintana opened this issue Oct 14, 2021 · 2 comments
Open

Feature: apply changes following plan order #37

gquintana opened this issue Oct 14, 2021 · 2 comments

Comments

@gquintana
Copy link
Contributor

When running

  topics:
    - name: topic1
      partitions: 3
      replication_factor: 2
    - name: topic2
      partitions: 3
      replication_factor: 2

The output is

TASK [CREATE] Create a new topic topic2 (partitions=3, replicas=2) - OK ****************************
TASK [CREATE] Create a new topic topic1 (partitions=3, replicas=2) - OK ****************************

Topics are created following a random order, it makes it hard

  • to check what's being done (or about to be done when dry run mode)
  • to debug the plan content

I'd like the plan ordered to be respected

@gquintana
Copy link
Contributor Author

The source problem is that all changes are stored as Maps.

Trying to implement this feature, I noticed that computing changeset to apply was done differently in ACLs and Topics.
I tried to refactor the TopicChange/AclChange to share same logic, this is how and why I created ChangeComputer
My current code is here https://github.com/gquintana/kafka-specs/tree/feat/ordered-changes/src/main/java/io/streamthoughts/kafka/specs/change It's far from being finished (it doesn't compile).
I am having hard times bridging this with *Operation, I fear it's a dead end, and I am not sure whether this change is a good idea or not.

What do you think? Should I dig deaper?

@fhussonnois
Copy link
Member

Currently, the Change API is not very well designed...no doubt about it! But, the ChangeComputer class that you introduce seems to be a good idea. I've recently added support for quotas and changes are computed mostly like for topics.

Also, changes for Topics/Quotas should accept some flags to indicate if deletions should be computed (like for ACLs). This is related to this issue : #45

Unfortunately, I'm not sure if, in the end, it's possible to keep the order of execution, as changes are applied in batches and by type (i.e. delete, create and modify).

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

No branches or pull requests

2 participants