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

Early warning sytem for postgres' transaction ID wraparound #12

Merged
merged 3 commits into from
Feb 1, 2022
Merged

Conversation

priiiiit
Copy link
Contributor

@priiiiit priiiiit commented Sep 22, 2021

Based on this blog post from AWS, it implements a warning system to avoid transaction ID wraparound.

If this alarm is triggered, you should check your AUTOVACUUM progress. More info about this in AWS blog "Understanding autovacuum in Amazon RDS for PostgreSQL environments"

New resources:

  • aws_cloudwatch_metric_alarm.maximum_used_transaction_ids_too_high

New inputs:

  • var.engine - by default it is set to an empty string. If that is configured to be either postgres or aurora-postgresql (same values that are used for aws_db_instance), then this new alarm is created.
  • var.maximum_used_transaction_ids_too_high_threshold - set to 1,000,000,000 (1 billion), as recommended by AWS blog post mentioned above.

New outputs:

  • alarm_maximum_used_transaction_ids_too_high

All resources, inputs and outputs are following the same naming and style convention as existing code. Only real difference is the conditional creation in case it is a postgres engine.

Tested and already in daily use in prod. Backwards compatible, does not affect existing setups.

@priiiiit
Copy link
Contributor Author

@lorenzoaiello, have you abandoned this module? If you don't have time to maintain, then I am happy to take over.

@lorenzoaiello lorenzoaiello added the enhancement New feature or request label Feb 1, 2022
Copy link
Owner

@lorenzoaiello lorenzoaiello left a comment

Choose a reason for hiding this comment

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

looks good, thanks @ppihus

@lorenzoaiello lorenzoaiello merged commit 8a9c8c0 into lorenzoaiello:master Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants