Skip to content

Conversation

samrose
Copy link
Collaborator

@samrose samrose commented Aug 12, 2025

these changes will NOT be merged into develop or promoted to production

The purpose of this draft pr is to create an image that has coredumps enabled per our internal playbook, for testing segfault issues. We will not merge this PR, or release the images created with it. It will be closed without merging when testing is completed.

these changes will NOT be merged into develop or promoted to production
  1. Removed the notify: update grub lines from the GRUB update tasks
  2. Added register variables to track if changes were made
  3. Added a conditional task to run update-grub only when changes occurred
  4. Removed the invalid handler definition at the end of the file
## Using GDB:
To analyze a coredump:
```
sudo gdb postmaster -c /pg_coredump_debug/<core_file>
Copy link
Contributor

Choose a reason for hiding this comment

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

I had to pass full path instead of just postmaster:

sudo gdb /nix/store/56va3gd07cakgapybcw4iq1irhx9lryx-postgresql-and-plugins-17_11/bin/.postgres-wrapped -c /pg_coredump_debug/core..postgres-wrapp.2150.1755075766

I'm not sure how properly can I find the path. One can try:

ls -lh /nix/store/*/bin/.postgres-wrapped
-r-xr-xr-x 3 root root 11M Jan  1  1970 /nix/store/56va3gd07cakgapybcw4iq1irhx9lryx-postgresql-and-plugins-17_11/bin/.postgres-wrapped

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you can also find it in /var/lib/postgresql/.nix-profile/bin so there actually is already a conventional location (I just used the same "home" dir for the postgres user that infra team created before I did all the nix packaging, to make it easier for people to orient themselves who were already familiar with /var/lib/postgresql homedir)

Copy link
Contributor

Choose a reason for hiding this comment

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

In my case I had to use the .postgres-wrapped file which isn't in /var/lib/postgresql/.nix-profile/bin. TBH not sure how it is related to the original postgres binary file.

Co-authored-by: Artur Zakirov <zaartur@gmail.com>
@samrose
Copy link
Collaborator Author

samrose commented Aug 13, 2025

We'll end up converting this from ansible to a nix package configuration that can be installed/uninstalled this was just a short term measure/test to see if this would work

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.

2 participants