Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dsessler7
Copy link
Contributor

@dsessler7 dsessler7 commented Sep 3, 2025

…processes.

Add ability to send pgbackrest logs to additional volume for repo host processes.

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)

Other Information:

Comment on lines +116 to +118
// Logging configuration for pgbackrest processes running in postgres instance pods.
// +optional
Log *LoggingConfiguration `json:"log,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am open to other ideas for the placement of this LoggingConfiguration.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do wonder if there would be an even better place to put it, but not sure where, so: Seems reasonable to me for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... Theoretically users could have multiple InstanceSets that have different additional volumes mounted, which would mean we'd need to allow different log paths per InstanceSet... So maybe the LoggingConfiguration should go on the PostgresInstanceSetSpec struct? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

But we mount the same pgbackrest config to every postgres pod, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking that we had a different pgbackrest_instance.conf file per InstanceSet, but it seems you are correct... Only one pgbackrest_instance.conf regardless of the number of InstanceSets... Do we move the Volumes.Additional out of the PostgresInstanceSetSpec and into the PostgresClusterSpec and mount them into all instances so the log paths can be consistent amongst instances? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

But then we'd be mounting the same PVC to all the different InstanceSet pods and having them all write to the same locations. (Which actually is the situation now if you have a single instanceSet with multiple replicas, so... it's already a fraught situation.)

Since we currently only allow people to bring their own volumes (rather than set up a template), people have to be a little careful about the pods-volumes connections. The safest scenario would probably be something like

  • multiple instance sets
  • each with only 1 replica
  • each with the same name of additional volumes but different PVC claims

That way, the config remains the same without any worry about collisions/overwriting between processes (where does each pod log? to the PVC that only that pod is connected)

Copy link
Contributor

Choose a reason for hiding this comment

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

In other words, I think this is (for now) going to be a lot of socialization and documentation.

@dsessler7 dsessler7 force-pushed the custom-pvcs-pgbackrest-logs branch 4 times, most recently from acabe60 to 1312df1 Compare September 5, 2025 21:27
@dsessler7 dsessler7 marked this pull request as ready for review September 9, 2025 21:36
@dsessler7 dsessler7 force-pushed the custom-pvcs-pgbackrest-logs branch from 69d7ce8 to a8dceef Compare September 10, 2025 00:25
Copy link
Contributor

@benjaminjb benjaminjb left a comment

Choose a reason for hiding this comment

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

LGTM, but still have that question about annotation & additional volumes

@dsessler7 dsessler7 force-pushed the custom-pvcs-pgbackrest-logs branch 2 times, most recently from 9bb7e57 to 1cbac34 Compare September 15, 2025 20:26
@dsessler7 dsessler7 force-pushed the custom-pvcs-pgbackrest-logs branch from f5261ca to 9c39b1e Compare September 16, 2025 19:55
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