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

SELECT 💣(); #8270

Merged
merged 5 commits into from
Jul 5, 2024
Merged

SELECT 💣(); #8270

merged 5 commits into from
Jul 5, 2024

Conversation

bayandin
Copy link
Member

@bayandin bayandin commented Jul 4, 2024

Problem

We want to be able to test how our infrastructure reacts on segfauls in Postgres (for example, we collect core dumps, get some required logs/metrics, etc)

Summary of changes

  • Add trigger_segfauls function to neon_test_utils to trigger a segfault in Postgres
  • Add trigger_panic function to neon_test_utils to trigger SIGABRT (by using `elog(PANIC, ...))
  • Fix cleanup logic in regression tests in endpoint crashed

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

@bayandin bayandin requested a review from a team as a code owner July 4, 2024 18:37
@bayandin bayandin requested a review from MMeent July 4, 2024 18:37
Copy link

github-actions bot commented Jul 4, 2024

3042 tests run: 2927 passed, 0 failed, 115 skipped (full report)


Flaky tests (2)

Postgres 16

  • test_sharding_split_compaction[None]: debug

Postgres 15

  • test_peer_recovery: debug

Code coverage* (full report)

  • functions: 32.6% (6929 of 21274 functions)
  • lines: 50.0% (54437 of 108936 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
ce27f53 at 2024-07-05T11:42:10.821Z :recycle:

Copy link
Contributor

@kelvich kelvich left a comment

Choose a reason for hiding this comment

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

awesome!

@kelvich
Copy link
Contributor

kelvich commented Jul 4, 2024

And you, perhaps, need to bump extension version and write migration script.

Copy link
Contributor

@MMeent MMeent left a comment

Choose a reason for hiding this comment

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

Why do we need this? I don't see it.

@kelvich
Copy link
Contributor

kelvich commented Jul 4, 2024

Why do we need this? I don't see it.

version bump or function to segfault? If latter then to test crash behavior (e.g. will compute_ctl restart postgres) and test coredump collection / printing

@bayandin
Copy link
Member Author

bayandin commented Jul 5, 2024

Why do we need this? I don't see it.

Added it to the description:

We want to be able to test how our infrastructure reacts on segfauls in Postgres (for example, we collect core dumps, get some required logs/metrics, etc)

Haven't noticed Stas' answer, but the idea is the same

@MMeent
Copy link
Contributor

MMeent commented Jul 5, 2024

Could we then also have one that does elog(PANIC, "...") to simulate such types of bad situations?

@bayandin
Copy link
Member Author

bayandin commented Jul 5, 2024

And you, perhaps, need to bump extension version and write migration script.

I bumped the version. Don't think the migration script is required for this one (we're pretty chill about it for test extension, for example, the previous changes 75c84c8)

@bayandin bayandin requested a review from MMeent July 5, 2024 10:52
@bayandin bayandin merged commit c9fd8d7 into main Jul 5, 2024
66 checks passed
@bayandin bayandin deleted the bayandin/💣 branch July 5, 2024 14:12
@skyzh
Copy link
Member

skyzh commented Jul 5, 2024

Note that this extension can be directly used by our users, so I would avoid putting things that might crash compute in that... There was an attempt to remove user access but autoscaling tests need this extension so it was reverted. #7679

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.

None yet

4 participants