Skip to content

KAFKA-9066: Retain metrics for failed tasks#8502

Merged
rhauch merged 3 commits into
apache:trunkfrom
C0urante:kafka-9066
Jun 11, 2020
Merged

KAFKA-9066: Retain metrics for failed tasks#8502
rhauch merged 3 commits into
apache:trunkfrom
C0urante:kafka-9066

Conversation

@C0urante

@C0urante C0urante commented Apr 16, 2020

Copy link
Copy Markdown
Contributor

Jira

Right now, sink and source task JMX metrics are dropped as soon as the task fails. The changes here cause these metrics to be retained even if the task fails, and instead only be removed when the task has been shut down (in preparation for a rebalance, due to reconfiguration, or because of connector deletion) or abandoned during that shutdown process by the worker.

Existing unit tests are modified to account for this tweak in the worker logic.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@C0urante

Copy link
Copy Markdown
Contributor Author

@gharris1727, @cyrusv, @ncliang, would any of you mind taking a look when you have a moment?

@ncliang ncliang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @C0urante . I have just one question about the need for separate methods to be implemented instead of overriding the method in subclass.

Comment thread connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java Outdated

@ncliang ncliang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @C0urante . LGTM.

@C0urante

Copy link
Copy Markdown
Contributor Author

Thanks @ncliang! @rhauch, @kkonstantine would one of you mind taking a look at this when you have a moment?

@rhauch

rhauch commented May 23, 2020

Copy link
Copy Markdown
Contributor

ok to test

@rhauch

rhauch commented Jun 5, 2020

Copy link
Copy Markdown
Contributor

retest this please

@rhauch

rhauch commented Jun 10, 2020

Copy link
Copy Markdown
Contributor

Retest this please

@rhauch

rhauch commented Jun 11, 2020

Copy link
Copy Markdown
Contributor

One concern I have is that we're not actually verifying in any of the tests that the task metrics are cleaned up when a connector is deleted, and that the tasks that remain after a worker fails are cleared and don't hinder the re-creation of the task metrics if the connector is restarted. Thoughts?

@C0urante

Copy link
Copy Markdown
Contributor Author

@rhauch it'd be nice to verify this in tests but unfortunately I didn't notice your comment earlier in the day and I don't think I have time to adjust/write new test cases to account for this. It also looks like the possibility you pointed out about hindering re-creation of task metrics isn't super likely given that tasks proactively clear out any metrics set up for older instances on startup:

// prevent collisions by removing any previously created metrics in this group.
metricGroup.close();

If this is still a sticking point, could we log a backlog ticket for those testing improvements and address it as time permits after the 2.6 release?

@rhauch

rhauch commented Jun 11, 2020

Copy link
Copy Markdown
Contributor

@C0urante the original PR description doesn't mention that the task metrics for a failed task will also be removed when the connector is deleted (in addition to the worker stopping or the tasks completing gracefully). Can you confirm my understanding, and if I'm right can you please update the description?

@C0urante

Copy link
Copy Markdown
Contributor Author

@rhauch sure, I can update the description to make it clear that we will still remove task metrics when a connector is deleted.

@rhauch rhauch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @C0urante. LGTM.

@rhauch
rhauch merged commit 775f0d4 into apache:trunk Jun 11, 2020
rhauch pushed a commit that referenced this pull request Jun 11, 2020
Author: Chris Egerton <chrise@confluent.io>
Reviewers: Nigel Liang <nigel@nigelliang.com>, Randall Hauch <rhauch@gmail.com>
rhauch pushed a commit to rhauch/kafka that referenced this pull request Jun 11, 2020
Author: Chris Egerton <chrise@confluent.io>
Reviewers: Nigel Liang <nigel@nigelliang.com>, Randall Hauch <rhauch@gmail.com>
Kvicii pushed a commit to Kvicii/kafka that referenced this pull request Jun 13, 2020
* 'trunk' of github.com:apache/kafka: (42 commits)
  HOTFIX: Fix compile error in TopicAdminTest (apache#8866)
  KAFKA-10144: clean up corrupted standby tasks before attempting a commit (apache#8849)
  KAFKA-10157: Fix broken tests due to InterruptedException from FinalizedFeatureChangeListener (apache#8857)
  KAFKA-9432: automated protocol for DescribeConfigs (apache#8312)
  KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes (apache#8764)
  KAFKA-10027: Implement read path for feature versioning system (KIP-584) (apache#8680)
  KAFKA-10085: correctly compute lag for optimized source changelogs (apache#8787)
  KAFKA-10086: Integration test for ensuring warmups are effective (apache#8818)
  KAFKA-9374: Make connector interactions asynchronous (apache#8069)
  MINOR: reduce sizeInBytes for percentiles metrics (apache#8835)
  KAFKA-10115: Incorporate errors.tolerance with the Errant Record Reporter (apache#8829)
  KAFKA-9216: Enforce that Connect’s internal topics use `compact` cleanup policy (apache#8828)
  KAFKA-9845: Warn users about using config providers with plugin.path property (apache#8455)
  KAFKA-7833: Add missing test (apache#8847)
  KAFKA-9066: Retain metrics for failed tasks (apache#8502)
  KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment (apache#8453)
  KAFKA-9985: Sink connector may exhaust broker when writing in DLQ (apache#8663)
  KAFKA-9441: remove prepareClose() to simplify task management (apache#8833)
  KAFKA-7833: Add Global/StateStore name conflict check (apache#8825)
  KAFKA-9969: Exclude ConnectorClientConfigRequest from class loading isolation (apache#8630)
  ...
rhauch pushed a commit to rhauch/kafka that referenced this pull request Jul 30, 2020
Author: Chris Egerton <chrise@confluent.io>
Reviewers: Nigel Liang <nigel@nigelliang.com>, Randall Hauch <rhauch@gmail.com>
rhauch added a commit that referenced this pull request Jul 30, 2020
Author: Chris Egerton <chrise@confluent.io>
Reviewers: Nigel Liang <nigel@nigelliang.com>, Randall Hauch <rhauch@gmail.com>, Konstantine Karantasis <konstantine@confluent.io>
rhauch added a commit that referenced this pull request Aug 12, 2020
Author: Chris Egerton <chrise@confluent.io>
Reviewers: Nigel Liang <nigel@nigelliang.com>, Konstantine Karantasis <konstantine@confluent.io>, Randall Hauch <rhauch@gmail.com>
ijuma added a commit to ijuma/kafka that referenced this pull request Nov 17, 2020
…t-for-generated-requests

* apache-github/trunk: (248 commits)
  KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes (apache#8764)
  KAFKA-10027: Implement read path for feature versioning system (KIP-584) (apache#8680)
  KAFKA-10085: correctly compute lag for optimized source changelogs (apache#8787)
  KAFKA-10086: Integration test for ensuring warmups are effective (apache#8818)
  KAFKA-9374: Make connector interactions asynchronous (apache#8069)
  MINOR: reduce sizeInBytes for percentiles metrics (apache#8835)
  KAFKA-10115: Incorporate errors.tolerance with the Errant Record Reporter (apache#8829)
  KAFKA-9216: Enforce that Connect’s internal topics use `compact` cleanup policy (apache#8828)
  KAFKA-9845: Warn users about using config providers with plugin.path property (apache#8455)
  KAFKA-7833: Add missing test (apache#8847)
  KAFKA-9066: Retain metrics for failed tasks (apache#8502)
  KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment (apache#8453)
  KAFKA-9985: Sink connector may exhaust broker when writing in DLQ (apache#8663)
  KAFKA-9441: remove prepareClose() to simplify task management (apache#8833)
  KAFKA-7833: Add Global/StateStore name conflict check (apache#8825)
  KAFKA-9969: Exclude ConnectorClientConfigRequest from class loading isolation (apache#8630)
  KAFKA-9991: Fix flaky unit tests (apache#8843)
  KAFKA-10014; Always try to close all channels in Selector#close (apache#8685)
  KAFKA-10079: improve thread-level stickiness (apache#8775)
  MINOR: Print all removed dynamic members during join complete (apache#8816)
  ...
@C0urante
C0urante deleted the kafka-9066 branch November 19, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants