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

ADAPT-1435: Add replacementTopics & previousTopics fields to track lineage of a deprecated topic #861

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

aman-minz
Copy link
Contributor

@aman-minz aman-minz commented Jul 14, 2023

PR for ADAPT-1435 introduces new fields as below to track the lineage of a topic being deprecated.

NOTE: The metadata fields replacementTopics & previousTopics should be populated by the producers of a topic.

replacementTopics:

  1. Whenever a topic is deprecated it is tedious for the consumers to track the new topic which should be used instead.
  2. Consumers required a field where the replacement topic could be assigned by the producers.
  3. Thus, replacementTopics field in metadata was conceived.
  4. This field is a list as a deprecated topic could be broken into multiple topics.
  5. Validations:
    • Accept only supported pattern of the topic name.
    • [Only on topics created after this fix] replacementTopics field must be set whenever the current topic is deprecated.

previousTopics:

  1. This field alone was not enough to trace the lineage at one glance.
  2. With replacementTopics, one could trace the lineage from old-to-new.
  3. However, to find lineage in other direction (i.e. new-to-old), one has to traverse from the deprecated topics to the newest topic.
  4. Therefore, another metadata field, previousTopics was conceived.
  5. This field needs be populated in the new topic which is created to replace a deprecated topic.
  6. This field is a list as it should contain all previous topics which were deprecated and replaced by the current topic.
  7. Validations:
    • Accept only supported pattern of the topic name.

additionalValidations:

  1. Sometimes additional validations are required which should not affect the existing topics.
  2. In other words, the additional validations should be applied only on the new topics and not the existing/old topics.
  3. To accomplish this, we had introduced cutoff-date environment variable. However, once a date is set, it is ideally never going to change.
  4. Therefore, why not have a field in the metadata to decide whether to apply an additional validation or not.
  5. additionalValidations is introduced to get rid of cutoff-date.
  6. It contains a list of enums denoting the type of validations to apply.
  7. Enum could be corresponding to a field or a custom validation which should be applied only on the new topics.
  8. [Past] Existing topics before this feature will have nothing in additionalValidations. Therefore, no new additional validations will be applied on them.
  9. [Present] New topics after this fix will have replacementTopics. Thus, corresponding field will be validated.
  10. [Future] When new enum values are added, the additionalValidations field of only the new topics will be updated with all additionalValidations including new enums. Thus, new additional validations will be applied henceforth.

@aman-minz aman-minz marked this pull request as draft July 17, 2023 04:38
@aman-minz aman-minz changed the title WIP-ADAPT-1435: Add place holders for replacementTopic & previousTopics ADAPT-1435: Add place holders for replacementTopic & previousTopics Jul 20, 2023
irynabiletskaps and others added 5 commits August 3, 2023 18:56
Revert rbac and Mykola's tests (temporary)
Revert BACK rbac and Mykola's tests
)

* ADAPT-1256: Close Default Loophole for fields - By Abhishek & Aman

* Fixing unit test cases - From Aman & Abhishek

* Fix compilation issue and update tests

* Add more tests

* Add more tests

* Remove unused import

* Revert TopicDeletionProgramSpec as the methods call across modules fails

* ADAPT-1566: add retries for getVersion and getAllVersions from schema… (#849)

* ADAPT-1566: add retries for getVersion and getAllVersions from schema registry

* ADAPT-1148: added msk rbac (#845)

* ADAPT-1148: added msk rbac

* ADAPT-1148: make msk arn env var as optional (#850)

* ADAPT-1256: Close Default Loophole for fields - By Abhishek & Aman

* Fixing unit test cases - From Aman & Abhishek

* Add more tests

* Incorporate review comments

* ADAPT-1256: Close Default Loophole for fields - By Abhishek & Aman

* Add more tests

* Add test for InstantUtils and refactor

* ADAPT-1570 Need a mechanism to validate logical types (#851)

* ADAPT-1570 Need a mechanism to validate logical types

* ADAPT-1570 Need a mechanism to validate logical types
*added tests for comosite keys

---------

Co-authored-by: Mykola Nikulesko <mykola.nikulesko@agileengine.com>

* ADAPT-1256: Close Default Loophole for fields - By Abhishek & Aman

* Add test for InstantUtils and refactor

* Incorporate review comments

* Refactored and removed unwanted variables and methods

* Store default loophole cutoff date in a variable

* Fix failing unit test

* Remove InstantUtils.scala

* Update default loophole cut-off date

---------

Co-authored-by: Abhishek <abhishek-verma@pluralsight.com>
Co-authored-by: Iryna Biletska <93545362+irynabiletskaps@users.noreply.github.com>
Co-authored-by: mnikulesko <96866310+mnikulesko@users.noreply.github.com>
Co-authored-by: Mykola Nikulesko <mykola.nikulesko@agileengine.com>
@aman-minz aman-minz changed the title ADAPT-1435: Add place holders for replacementTopic & previousTopics ADAPT-1435: Add replacementTopics & previousTopics fields to track lineage of deprecated topic Aug 3, 2023
@aman-minz aman-minz changed the title ADAPT-1435: Add replacementTopics & previousTopics fields to track lineage of deprecated topic ADAPT-1435: Add replacementTopics & previousTopics fields to track lineage of a deprecated topic Aug 8, 2023
@olivierlacan
Copy link

Is this still planned?

@aman-minz
Copy link
Contributor Author

Is this still planned?

Yes, @olivierlacan. However, we have few other PRs which needs to go before this. We will update you as soon as this is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants