You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Tan-JiaLiang (via GitHub)" <gi...@apache.org> on 2024/01/15 10:47:24 UTC

[PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Tan-JiaLiang opened a new pull request, #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   When we unsubscribe a topic and still restore from the old state, the job will still read data from the unsubscribed topic. I think we should check if that the subscribed topic partitions match the assigned partitions, and throw an error so the user can handle it.
   
   ## Brief change log
   
     - *Verify that the subscribed topics match the assigned topics.*
   
   
   ## Verifying this change
   
   
   This change is already covered by existing tests, such as
     - *org.apache.flink.streaming.connectors.kafka.table.KafkaTableITCase#testChangingSubscribedTopicsBeforeResuming.*
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "Tan-JiaLiang (via GitHub)" <gi...@apache.org>.
Tan-JiaLiang commented on PR #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77#issuecomment-1899618447

   @MartijnVisser 
   Suppose there is a flink job that subscribes two topics in a source at the same time, TopicA and TopicB.
   
   * Write some data to both TopicA and TopicB.
   * Stop the job with savepoint, the offset of TopicA and TopicB will be saved in savepoint.
   * Now I change the subscribe topic list, subscribe only the TopicB, and restore from the last savepoint.
   * The Flink job will still consume the TopicA record, which will make user feel confused.
   
   So I think it is better to clearly tell the user that we cannot restore from the savepoint because the subscribe list has been changed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77#issuecomment-1898677487

   > When we unsubscribe a topic and still restore from the old state, the job will still read data from the unsubscribed topic.
   
   Isn't this by design? If we would change this, we would rely on Kafka for failure recovery, which is something that we don't want to do. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser closed pull request #77: [FLINK-34089] Verify that the subscribed topics match the assigned topics
URL: https://github.com/apache/flink-connector-kafka/pull/77


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "Tan-JiaLiang (via GitHub)" <gi...@apache.org>.
Tan-JiaLiang commented on PR #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77#issuecomment-1892967906

   @tzulitai Hi gordon, can you take a look when you are free?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "Tan-JiaLiang (via GitHub)" <gi...@apache.org>.
Tan-JiaLiang commented on PR #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77#issuecomment-1900142817

   But users need to know that they should not use checkpoint & savepoint to restore when they change the subscription topic list. Should we add a validation to prevent users from making mistakes?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "Tan-JiaLiang (via GitHub)" <gi...@apache.org>.
Tan-JiaLiang commented on PR #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77#issuecomment-1899714802

   But now I am thinking more carefully, maybe just removing the topics from state that are not in the current subscription list is a better solution.
   
   @MartijnVisser @tzulitai WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77#issuecomment-1899948823

   > But now I am thinking more carefully, maybe just removing the topics from state that are not in the current subscription list is a better solution.
   
   That's what a user indeed should do at this point. Just removing an input topic has implications on your pipeline, and users shouldn't just do that. If users have a requirement to (dynamically) add or remove Kafka topics, they should use the solution that has been brought forward with https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=217389320


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-34089] Verify that the subscribed topics match the assigned topics [flink-connector-kafka]

Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #77:
URL: https://github.com/apache/flink-connector-kafka/pull/77#issuecomment-1900152500

   > But users need to know that they should not use checkpoint & savepoint to restore when they change the subscription topic list.
   
   Users still can, but they have to take into consideration the same thing as if you would delete an operator from their job. That's already documented at https://nightlies.apache.org/flink/flink-docs-master/docs/ops/state/savepoints/#what-happens-if-i-delete-an-operator-that-has-state-from-my-job


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org