question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve output for topic changes on dryRun and apply

See original GitHub issue

There have been multiple other issues (#220, #102, #109) on this subject and also a PR that got closed. This issue proposes a solution for the most pressing issues, including the need for a refactor of code related to this.

Is your feature request related to a problem? Please describe.

Functional issues with current solution

Currently JulieOps only logs planned changes during a dryRun execution. For topics the logging also has the following issues:

  • It is not possible to get a log of the actual topic changes for topic config updates.
    • The update topic action is performed regardless of any changes to topic configuration (topology vs cluster state). This is not a problem in the logging as such, but the fact that Julie always updates config for all topics in the topology (apply phase) might be confusing.
  • Similarly there is no logging of what config is set for a new topic
  • It is difficult to get an overview of new vs updated topics, because there is no ordering of action execution. Create and update topic action exections are intermingled and so is the logging.

For bindings (ACLs/RBAC etc) the logging is correct as the actual new/changed ACLs is updated and logged. However there are also a corresponding issue that currently there is no logging of the updates done on schemas.

In addition the apply phase does not log the changes that have actually been performed; only a listing of all topics and all ACLs in the cluster.

Technical issues with current solution

  • SyncTopicAction is doing too many things:
    • Creating new topics
    • Updating topic config
    • Adding schemas to Schema Registry
  • Wording is misleading for some core methods. For example TopicManager.apply indicates that the manager will apply the supplied ExecutionPlan, but rather actions is added to the plan.
  • The classes for building of bindings (for later update to ACLs etc) is modeled as subclasses of BaseAction although they are not actions - only creating the bindings that will later be used by actions.
  • Interface ManagerOfThings: Naming is not very descriptive. Should also be implemented by all managers if a common interface is needed.
  • Would be better to handle printing of the execution log in another way than just doing toString on the actions. Maybe re-design to facilitate different outputs? JSON vs more compact humen readable?

Describe the solution you’d like

Proposal for functional changes

  • Execution plan logging for topic is changed to log the actual config changes (topology vs cluster state)
    • So only topics with actual changes to the config will be updated towards the cluster
  • Logging/execution of new vs updated topics is ordered, with new topic being logged first
    • Also changing the ordering of the actual executions
  • For apply phase also print the execution log -> what have been changed in the cluster

Example of new logs for topic and schemas changes:

{
  "Operation" : "com.purbon.kafka.topology.actions.topics.CreateTopicAction",
  "Topic" : "schemas.json.foo.bar.avro",
  "Action" : "create"
}

{
  "Operation" : "com.purbon.kafka.topology.actions.topics.UpdateTopicConfigAction",
  "Topic" : "testTopicConfigUpdate-test.project.topicA",
  "Action" : "update",
  "Changes" : {
    "NewConfigs" : {
      "min.insync.replicas": "2"
    },
    "UpdatedConfigs" : {
      "retention.bytes" : "104"
    },
    "DeletedConfigs" : {
      "segment.bytes" : "104857600"
    },
   "UpdatedPartitionCount": "3"
  }
}

{
  "Operation" : "com.purbon.kafka.topology.actions.topics.DeleteTopics",
  "topics" : [ "testTopicCreationWithChangedTopology.project.topicB", "testTopicCreationWithChangedTopology.project.topicA" ]
}

{
  "Operation" : "com.purbon.kafka.topology.actions.topics.RegisterSchemaAction",
  "Topic" : "schemas.avro.foo.cat.avro",
  "Schemas" : {
    "schemas.avro.foo.cat.avro-key" : "schemas/bar-key.avsc",
    "schemas.avro.foo.cat.avro-value" : "schemas/bar-value.avsc"
  }
}

Proposal for technical changes

Some refactoring is required to support the functional improvements:

  • Split SyncTopicAction into CreateTopicAction, SyncTopicConfigAction and RegisterSchemaAction.
  • Refactoring of how updates on config is done: First build a model of the actual changes to be done (i.e. what configs have actually changed), then give that model to the action. That model should also be basis for execution plan/log.
  • Refactoring of how execution plan/log is printed
  • Redesign BuildBindings-classes, should not be actions
  • Renaming of ManagerOfThings and interface methods

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
akselhcommented, Jul 12, 2021

I have not gotten any feedback from @purbon, but we have started work on a PR. Right now we have entered summer holidays, will pick it up again in August. 🌞😎

0reactions
akselhcommented, Aug 10, 2021

Hi @purbon, hope summer has been good! Still on summer vacation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create and change the Kubernetes yaml using dry-run ...
How to create and change the Kubernetes yaml using dry-run and edit ... This will output a yaml file you can then apply/create...
Read more >
Dry Run Testing in Software Development - Study.com
Learn about these processes, specifically focusing on the procedure and benefits of dry run testing in software development.
Read more >
How to write NSO-action (python) to get its dry-run output?
Got a requirement to create a NSO action wherein customer want ability to run action to see its dry-run output, before actually committing...
Read more >
Team Canvas Dry Run – Improve Facilitation - GoRetro
It gives us a foundation on which we can build our strengths, a safe space to experiment. Given the current rate of growth...
Read more >
The NEST Dry-Run Mode: Efficient Dynamic Analysis of ...
Hence, developers need to test their code for various use cases and ensure that changes to code do not impair scalability. However, running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found