-
Notifications
You must be signed in to change notification settings - Fork 14.9k
KAFKA-9726: Add IdentityReplicationPolicy for MM2 #10648
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
Conversation
bb4d580 to
e739bf7
Compare
|
There seems to be spurious test failures that is unrelated to the PR, let me know if I need to do something about it (i.e. retrigger the CI?) |
|
Thanks for the PR! As this is adding a new method to a public interface ( Also what about naming the new policy |
|
Thanks for picking this up. I have a similar effort here: #10652 (just posted). If we need to modify the interface, we'll definitely need a KIP. My PR doesn't change the interface, so I believe it's possible to avoid the KIP. That said, my PR is currently not passing, so maybe you are ahead of me :) wrt Legacy vs Identity, I am fine either way. I'm happy to touch-up KIP-382 to avoid confusion if we go with Identity. |
e739bf7 to
595acaf
Compare
|
@mimaison I have just renamed @ryannedolan I will have a look at #10652 early next week to see if I can avoid adding the method to the public interface otherwise I will create a KIP as it appears to be required. Are you guys happy with the |
|
KIP has been created at https://cwiki.apache.org/confluence/display/KAFKA/KIP-737%3A+Add+canTrackSource+to+ReplicationPolicy and a new thread has been started in the kafka-dev mailing list for this topic (let me know if anything more needs to be done). |
|
I still don't think an API change is required here. I was able to get your integration tests passing with this version of IdentityReplicationPolicy: https://github.com/apache/kafka/pull/10652/files#diff-79a09517576a35906123533490ed39c0e1a9416878e284d7b71f5f4c53eeca29R31 I just had to add this extra check to MirrorSourceConnector: which I think is probably harmless. Thoughts? |
This commit adds a new replication policy for MirrorMaker 2, `IdentityReplicationPolicy`. This policy imitates MirrorMaker 1 behavior of not renaming replicated topics. The exception is made for `heartbeats` topic, that is replicated according to `DefaultReplicationPolicy`. Avoiding renaming topics brings a number of limitations, among which the most important one is the impossibility of detecting replication cycles. This makes cross-replication using `IdentityReplicationPolicy` effectively impossible. See `IdentityReplicationPolicy` Javadoc for details. A new method `canTrackSource` is added to `ReplicationPolicy`. Its result indicates if the replication policy can track back to the source topic of a topic. It is needed to allow detecting target topics work when `IdentityReplicationPolicy` is used. On the testing side, the tests have the same strategy as for `IdentityReplicationPolicy` with necessary adjustments (e.g. no active/active replication is tested).
595acaf to
b0972a5
Compare
|
As discussed in the mailing list, the other PR is more suitable since it doesn't require a KIP, I will close this PR (it can be reopened later if something else changes) |
I am taking over the PR of #9395 which has been rebased to work with the latest
trunkof Kafka. As stated in the original PR, it adds aIdentityReplicationPolicyfor MirrorMaker2 (known asLegacyReplicationPolicy) which imitates the behavior of MirrorMaker1 (i.e. it doesn't rename the the topics apart fromheartbeat). The behavior of this PR is exactly the same as the stated original.Here are some additional notes/changes that are different from the original PR.
startClusters()has been added which allows you to supply test specific MirrorMaker configs. This allows theIdentityReplicationPolicytests to use as much more code from the baseMirrorConnectorsIntegrationBaseTest, heavily reducing boilerplate when compared to the original PR. Although It can be argued that you can just do.putdirectly on themm2PropsHashMap, this method is cleaner and more importantly better handles the case where you need to override an existing key (sincesuperneeds to be called last instartClustersit will override any existing keys which you may have configured in your own test)MirrorConnectorsIntegrationBaseTesthave been changed fromprivatetoprotectedso thatIdentityReplicationPolicyspecific tests can access them.@ryannedolan You reviewed the original PR and in that PR you stated that a KIP is needed since we are adding a public method to the
ReplicationPolicyinterface, is this still necessary? You also had issues with thecanTrackSourcemethod name, do you have a better alternative?Committer Checklist (excluded from commit message)
EDIT: Renamed
LegacyReplicationPolicytoIdentityReplicationPolicy