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

[GOBBLIN-1842] Add timers to GobblinMCEWriter #3703

Merged
merged 3 commits into from
Jun 28, 2023

Conversation

jack-moseley
Copy link
Contributor

Dear Gobblin maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

  • Here are some details about my PR, including screenshots (if applicable):
    Add timers for:
  • hivespec computation
  • write for each metadata writer
  • flush for each metadata writer

These timers are set up with a 1 hour sliding window, so the statistics will be for the last hour of execution. The timers are registered with metric context so they will send metrics through gobblin's metric framework. Also, added logging during every flush interval (every 1 min) which logs the current mean/99th percentile of every timer, so it is easier to see where time is being spent.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    Ran test pipeline. Example timer logs:
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - begin flushing 0 records
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.iceberg.writer.IcebergMetadataWriter.write 1 hour mean duration: 10 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.iceberg.writer.IcebergMetadataWriter.write 1 hour 99th percentile duration: 104 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.hive.writer.HiveMetadataWriter.write 1 hour mean duration: 14 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.hive.writer.HiveMetadataWriter.write 1 hour 99th percentile duration: 213 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.iceberg.writer.IcebergMetadataWriter.flush 1 hour mean duration: 3756 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.iceberg.writer.IcebergMetadataWriter.flush 1 hour 99th percentile duration: 69138 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.hive.writer.HiveMetadataWriter.flush 1 hour mean duration: 0 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer org.apache.gobblin.hive.writer.HiveMetadataWriter.flush 1 hour 99th percentile duration: 1 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer hiveSpec.computation 1 hour mean duration: 10 ms
2023-06-13 11:16:58 PDT INFO  [StreamModelTaskRunner] org.apache.gobblin.iceberg.writer.GobblinMCEWriter  - Timer hiveSpec.computation 1 hour 99th percentile duration: 19 ms

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Copy link
Contributor

@ZihanLi58 ZihanLi58 left a comment

Choose a reason for hiding this comment

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

As I see more time spending in flush, can we consider add more detail breaking down there, like how much time we spend to commit a transaction etc...

@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Merging #3703 (9032fe2) into master (a00b57c) will decrease coverage by 0.04%.
The diff coverage is 87.09%.

@@             Coverage Diff              @@
##             master    #3703      +/-   ##
============================================
- Coverage     46.89%   46.86%   -0.04%     
- Complexity    10772    10807      +35     
============================================
  Files          2138     2141       +3     
  Lines         84139    84465     +326     
  Branches       9357     9385      +28     
============================================
+ Hits          39456    39583     +127     
- Misses        41078    41279     +201     
+ Partials       3605     3603       -2     
Impacted Files Coverage Δ
...apache/gobblin/hive/writer/HiveMetadataWriter.java 0.00% <0.00%> (ø)
...pache/gobblin/iceberg/writer/GobblinMCEWriter.java 77.69% <93.18%> (+2.26%) ⬆️
.../gobblin/iceberg/writer/IcebergMetadataWriter.java 70.94% <100.00%> (-1.43%) ⬇️

... and 39 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jack-moseley
Copy link
Contributor Author

As I see more time spending in flush, can we consider add more detail breaking down there, like how much time we spend to commit a transaction etc...

Hmm, so you mean more timers within the indvidual writers? Yeah I guess I'll add some there, although I would think during flush the time is spent pretty much all in the commit. I guess it would be good to confirm that sending audit/commit events etc. is not taking much time.

Copy link
Contributor

@ZihanLi58 ZihanLi58 left a comment

Choose a reason for hiding this comment

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

+1

@ZihanLi58 ZihanLi58 merged commit 4813949 into apache:master Jun 28, 2023
6 checks passed
phet added a commit to phet/gobblin that referenced this pull request Aug 15, 2023
* upstream/master:
  Fix bug with total count watermark whitelist (apache#3724)
  [GOBBLIN-1858] Fix logs relating to multi-active lease arbiter (apache#3720)
  [GOBBLIN-1838] Introduce total count based completion watermark (apache#3701)
  Correct num of failures (apache#3722)
  [GOBBLIN- 1856] Add flow trigger handler leasing metrics (apache#3717)
  [GOBBLIN-1857] Add override flag to force generate a job execution id based on gobbl… (apache#3719)
  [GOBBLIN-1855] Metadata writer tests do not work in isolation after upgrading to Iceberg 1.2.0 (apache#3718)
  Remove unused ORC writer code (apache#3710)
  [GOBBLIN-1853] Reduce # of Hive calls during schema related updates (apache#3716)
  [GOBBLIN-1851] Unit tests for MysqlMultiActiveLeaseArbiter with Single Participant (apache#3715)
  [GOBBLIN-1848] Add tags to dagmanager metrics for extensibility (apache#3712)
  [GOBBLIN-1849] Add Flow Group & Name to Job Config for Job Scheduler (apache#3713)
  [GOBBLIN-1841] Move disabling of current live instances to the GobblinClusterManager startup (apache#3708)
  [GOBBLIN-1840] Helix Job scheduler should not try to replace running workflow if within configured time (apache#3704)
  [GOBBLIN-1847] Exceptions in the JobLauncher should try to delete the existing workflow if it is launched (apache#3711)
  [GOBBLIN-1842] Add timers to GobblinMCEWriter (apache#3703)
  [GOBBLIN-1844] Ignore workflows marked for deletion when calculating container count (apache#3709)
  [GOBBLIN-1846] Validate Multi-active Scheduler with Logs (apache#3707)
  [GOBBLIN-1845] Changes parallelstream to stream in DatasetsFinderFilteringDecorator  to avoid classloader issues in spark (apache#3706)
  [GOBBLIN-1843] Utility for detecting non optional unions should convert dataset urn to hive compatible format (apache#3705)
  [GOBBLIN-1837] Implement multi-active, non blocking for leader host (apache#3700)
  [GOBBLIN-1835]Upgrade Iceberg Version from 0.11.1 to 1.2.0 (apache#3697)
  Update CHANGELOG to reflect changes in 0.17.0
  Reserving 0.18.0 version for next release
  [GOBBLIN-1836] Ensuring Task Reliability: Handling Job Cancellation and Graceful Exits for Error-Free Completion (apache#3699)
  [GOBBLIN-1805] Check watermark for the most recent hour for quiet topics (apache#3698)
  [GOBBLIN-1825]Hive retention job should fail if deleting underlying files fail (apache#3687)
  [GOBBLIN-1823] Improving Container Calculation and Allocation Methodology (apache#3692)
  [GOBBLIN-1830] Improving Container Transition Tracking in Streaming Data Ingestion (apache#3693)
  [GOBBLIN-1833]Emit Completeness watermark information in snapshotCommitEvent (apache#3696)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants