Skip to content

sql: fix exporting of events to Obs Service#87054

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:obsservice.fix-export
Aug 31, 2022
Merged

sql: fix exporting of events to Obs Service#87054
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:obsservice.fix-export

Conversation

@andreimatei
Copy link
Copy Markdown
Contributor

@andreimatei andreimatei commented Aug 29, 2022

In #86174, exporting of events to the Obs Service was doubly-decoupled
from the SQL statement causing the event: it ran in an async task inside
another async task. The inner task was given a context canceled when the
outer task finished - thus introducing a race causing the event to not
be passed along. This was caught by TestEventIngestionIntegration
flakiness.
The second task was unnecessary. Its purpose was to shield the caller
from slow communication with the Obs Service, but the client library
being used already does that (it's non-blocking).

Release note: None
Release justification: bug fix, test flakiness

In cockroachdb#86174, exporting of events to the Obs Service was doubly-decoupled
from the SQL statement causing the event: it ran in an async task inside
another async task. The inner task was given a context canceled when the
outer task finished - thus introducing a race causing the event to not
be passed along. This was caught by TestEventIngestionIntegration
flakiness.
The second task was unnecessary. Its purpose was to shield the caller
from slow communication with the Obs Service, but the client library
being used already does that (it's non-blocking).

Release note: None
@andreimatei andreimatei requested review from a team and knz August 29, 2022 19:05
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@abarganier abarganier left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei and @knz)


pkg/sql/event_log.go line 616 at r1 (raw file):

			query, args, otelEvents := prepareEventWrite(ctx, execCfg, entries)

			// Send to the Obs Service.

nit: is it worth noting in a comment here that we don't need to worry about a "clogged" output queue to obsservice, since records are dropped?

Code quote:

// Send to the Obs Service.

Copy link
Copy Markdown
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

My apologies for the churn.

Copy link
Copy Markdown
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

TFTRs!

bors r+

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @abarganier)


pkg/sql/event_log.go line 616 at r1 (raw file):

Previously, abarganier (Alex Barganier) wrote…

nit: is it worth noting in a comment here that we don't need to worry about a "clogged" output queue to obsservice, since records are dropped?

I've made a note on the lower-level method that it's non-blocking. I think that's close enough to all the callers, so they don't have to repeat it.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 31, 2022

Build succeeded:

@craig craig bot merged commit d07bea8 into cockroachdb:master Aug 31, 2022
@andreimatei andreimatei deleted the obsservice.fix-export branch September 1, 2022 21:46
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.

4 participants