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

feat(meta): record barrier latency in event table #13633

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

zwang28
Copy link
Contributor

@zwang28 zwang28 commented Nov 24, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

part of #12826

Failed barrier doesn't write a event log.
Event log table only records latest 10 events for each type by default. We can customize it on demand.

dev=> select * from rw_catalog.rw_event_logs where event_type='BARRIER_COMPLETE';
              unique_id               |           timestamp           |    event_type    |                                                                                       info                                                                                       
--------------------------------------+-------------------------------+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 4be656b2-33c2-4e8d-970d-a4934ab51bd7 | 2023-11-24 03:43:31.623+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_BARRIER", "command": "Plain", "curEpoch": "5476333100859392", "durationSec": 0.000279333, "prevEpoch": "5476333035257856"}}
 4846bd92-34d1-4304-ae6d-47912abe90b7 | 2023-11-24 03:43:32.623+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_CHECKPOINT", "command": "Plain", "curEpoch": "5476333166395392", "durationSec": 0.000699541, "prevEpoch": "5476333100859392"}}
 db589497-764b-45eb-ab0c-d5ea03ab4cde | 2023-11-24 03:43:33.622+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_BARRIER", "command": "Plain", "curEpoch": "5476333231865856", "durationSec": 0.000150208, "prevEpoch": "5476333166395392"}}
 fac9942d-45de-42bd-b64d-a64ea088e105 | 2023-11-24 03:43:34.625+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_CHECKPOINT", "command": "Plain", "curEpoch": "5476333297598464", "durationSec": 0.00072525, "prevEpoch": "5476333231865856"}}
 a399701a-c8d9-4495-9712-20cf6271c12e | 2023-11-24 03:43:35.624+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_BARRIER", "command": "Plain", "curEpoch": "5476333363068928", "durationSec": 0.000285166, "prevEpoch": "5476333297598464"}}
 59adb71b-5219-4e04-a483-54cc73125120 | 2023-11-24 03:43:36.624+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_CHECKPOINT", "command": "Plain", "curEpoch": "5476333428604928", "durationSec": 0.00072925, "prevEpoch": "5476333363068928"}}
 bbcf96ca-37b9-414d-9825-88240a8b6768 | 2023-11-24 03:43:37.623+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_BARRIER", "command": "Plain", "curEpoch": "5476333494075392", "durationSec": 0.000203709, "prevEpoch": "5476333428604928"}}
 c90ec544-30bf-459d-b110-f1481c0c4a22 | 2023-11-24 03:43:38.623+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_CHECKPOINT", "command": "Plain", "curEpoch": "5476333559676928", "durationSec": 0.000251042, "prevEpoch": "5476333494075392"}}
 f1f65fc3-360f-4c44-a69b-9757ca996122 | 2023-11-24 03:43:39.625+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_BARRIER", "command": "Plain", "curEpoch": "5476333625278464", "durationSec": 0.000460625, "prevEpoch": "5476333559676928"}}
 9f8715ac-46fd-4034-808e-168dda20e0c7 | 2023-11-24 03:43:40.623+00:00 | BARRIER_COMPLETE | {"barrierComplete": {"barrierKind": "BARRIER_KIND_CHECKPOINT", "command": "Plain", "curEpoch": "5476333690748928", "durationSec": 0.000439125, "prevEpoch": "5476333625278464"}}
(10 rows)

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@zwang28 zwang28 requested a review from a team as a code owner November 24, 2023 03:43
@zwang28 zwang28 requested a review from yezizp2012 November 24, 2023 03:45
Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (9ae8705) 68.15% compared to head (a848ba7) 68.15%.
Report is 5 commits behind head on main.

Files Patch % Lines
...catalog/system_catalog/rw_catalog/rw_event_logs.rs 0.00% 5 Missing ⚠️
src/meta/src/manager/event_log.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13633   +/-   ##
=======================================
  Coverage   68.15%   68.15%           
=======================================
  Files        1519     1519           
  Lines      261508   261526   +18     
=======================================
+ Hits       178230   178246   +16     
- Misses      83278    83280    +2     
Flag Coverage Δ
rust 68.15% <73.91%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -76,7 +76,7 @@ pub struct Reschedule {
/// [`Command`] is the action of [`crate::barrier::GlobalBarrierManager`]. For different commands,
/// we'll build different barriers to send, and may do different stuffs after the barrier is
/// collected.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, strum::Display)]
Copy link
Member

Choose a reason for hiding this comment

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

Nits: the inner fields of some enum item could be extremely large, I'm not sure if we should pick and only display some important info manually only for them. It's acceptable for me to keep it this way since only latest 10 events will be recorded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

strum::Display only include the name. See example here.

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

Good idea!

@zwang28 zwang28 added this pull request to the merge queue Nov 24, 2023
Merged via the queue into main with commit f707c5f Nov 24, 2023
41 of 42 checks passed
@zwang28 zwang28 deleted the wangzheng/event_barrier branch November 24, 2023 06:32
@fuyufjh
Copy link
Member

fuyufjh commented Nov 29, 2023

I am a little bit suspicious about this PR. Because other event kinds are truely critical failures, while this one is more like a metric to me, even not worth a INFO-level log.

  • CreateStreamJobFail: the cleared tables and errors during foreground table creation.
  • DirtyStreamJobClear: the cleared tables during meta node recoveries.
  • BarrierComplete: the completed epoch, including latency collected in meta node.
  • InjectBarrierFail: the RPC error received by meta node.
  • CollectBarrierFail: the RPC error received by meta node.

@fuyufjh
Copy link
Member

fuyufjh commented Nov 29, 2023

Btw, I have once discussed with @BugenZhao about whether we can introduce a mini metrics store in Meta node, to keep some important metrics (e.g. barrier latency, fragment throughput, fragment backpressure, etc.) for dashboard without need of Prometheus.

If your motivation is to view the metrics without Prometheus, I think this might be better than recording BarrierComplete in event table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants