-
Notifications
You must be signed in to change notification settings - Fork 236
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
Remove the retry mechanism in MongoSinkTask #88
Conversation
Running `./gradlew check` results in some files being reformatted. I don't know why these files have not been reformatted, but I think this must be done to avoid interference with future changes. KAFKA-267
* href="https://docs.mongodb.com/kafka-connector/master/sink-connector/configuration-properties/topic-override/">here</a>. | ||
* @see #OBSOLETE_CONFIGS | ||
*/ | ||
static void logObsoleteProperties(final Collection<String> propertyNames) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if any configuration properties have been made obsolete up until now, and if so, what is the process. I think warning a user about still having these properties is useful, but if we have a different process of obsoleting configuration properties, please share.
@Documented | ||
@Retention(RetentionPolicy.SOURCE) | ||
@Target({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.FIELD}) | ||
public @interface VisibleForTesting { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No such annotation was available at compile-time, so I copied one from the MongoDB Java driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to provide a slightly more helpful warning message to users.
Also can you confirm the validateAll
is called when running / adding the connector?
.forEach( | ||
obsoletePropertyName -> | ||
LOGGER.warn( | ||
"The configuration property {} is obsolete. Remove it as it has no effect.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
Retries are obsolete but we should tell the user to set retryWrites=true
on their connection string. Otherwise this might cause a support burden as users ask questions about the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should tell the user to set retryWrites=true
I addressed this in the scope document:
The connector requires the Java driver 4.3.x, which has retries enabled by default, meaning that no changes are needed to utilize the mechanism.
I updated the message to reflect that a user does not need to do anything beyond removing the obsolete configuration properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think the message will lead to customer questions and therefore add support burden. It tells users what to do and not the why its no longer required.
Also although retries are enabled by default - if a user previously set retryWrites=false
thinking the Kafka connector retry mechanism is preferred then they do have to do some action to enable retryable writes.
While the logic for obsolete messages is clean and DRY, the warn message is only needed if max.num.retries > 1
and max.num.retries
defaults to 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tells users what to do and not the why its no longer required.
if a user previously set retryWrites=false thinking the Kafka connector retry mechanism is preferred then they do have to do some action to enable retryable writes.
Updated the warning message to address the above.
the warn message is only needed if max.num.retries > 1
I think that warning a user that he uses an obsolete configuration property is useful regardless of the property value. Additionally, the proposed logic
- is a complication just for the sake of not showing a warning message in some situations, despite the user specifying values for obsolete configuration properties;
- requires us to read and parse configuration values directly from
Map<String, String>
invalidateAll
as opposed to reading the values via theAbstractConfig
API.
Accordingly, I find the proposed logic harmful rather than helpful.
The method
|
…solete configuration properties KAFKA-267
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message should be relevant and explicit as to the what action is needed and why. This will reduce any support burden.
The MAX_NUM_RETRIES_DOC
and RETRIES_DEFER_TIMEOUT_DOC
should also be updated for the config definition.
Just trying to confirm that I understand the proposal correctly. Ross, do you want me to reinstate these two configuration properties, i.e., continue defining them via I see it like this:
Despite me not seeing this as a useful change, if you indeed proposed to reinstate the properties (I am not sure if that's the case), I will do that. |
KAFKA-267
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies @stIncMale I appear to have viewed the source at the first commit and missed that the configs were removed from the ConfigDef.
My only suggestion would be to map the the property name to the error message used in logObsoleteProperties
but that can be done when / if we obsolete any other properties.
LGTM!
Yes, since the warning message is not generic anymore, we will need different messages for different properties. When I saw your idea, I thought, maybe we can even express |
Omg, I got used to only one option when merging a PR being available for the Java driver, and blindly pressed the button here. As a result, it merged all the commits from the PR into Then I went and unchecked the "Allow merge commits" and "Allow rebase merging" checkboxes in the settings tab, only "Allow squash merging " is left checked. @rozza Do you agree we will be better this way? |
@stIncMale no worries - it happens :) I generally agree squash merging is the best approach, I suppose it depends on the PR and the commits. |
This is a subtask of KAFKA-257 created to produce smaller PRs.
CHANGELOG.md
will be updated once KAFKA-257 is complete, I left a reminder in this comment.TODO for @stIncMale: When this is merged, delete the branch
KAFKA-267
and change the "into" branch for #91 tomaster
.KAFKA-267