f002

package
v0.0.0-...-b15899e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CRITICAL_CAPACITY_USAGE float32 = 50.0
View Source
const F002_RISKS_ARE_HIGH = "F002_RISKS_ARE_HIGH"
View Source
const MSG_RISKS_ARE_HIGH_CONCLUSION_1 string = "[P1] Risks of transaction ID wraparound are high for:  \n" +
	"%s  \n" +
	"Approaching 100%% will lead to long downtime: the system will shut down and refuse to start until VACUUM is performed in single user mode.  \n"
View Source
const MSG_RISKS_ARE_HIGH_CONCLUSION_2 string = "More on this topic:  \n" +
	"    - [PostgreSQL Documentation. 24.1.5. Preventing Transaction ID Wraparound Failures](https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND)  \n" +
	"    - [The Internals of PostgreSQL. Chapter 5. Concurrency Control. 5.10.1. FREEZE Processing](http://www.interdb.jp/pg/pgsql05.html#_5.10.1.)  \n" +
	"    - [Transaction ID Wraparound in Postgres](https://blog.sentry.io/2015/07/23/transaction-id-wraparound-in-postgres) (2015, Sentry blog)  \n" +
	"    - [Autovacuum wraparound protection in PostgreSQL](https://www.cybertec-postgresql.com/en/autovacuum-wraparound-protection-in-postgresql/) (2017, Cybertec blog)  \n" +
	"    - [What We Learned from the Recent Mandrill Outage](https://mailchimp.com/what-we-learned-from-the-recent-mandrill-outage/) (2019, Mailchimp blog)  \n" +
	"    - [Managing Transaction ID Exhaustion (Wraparound) in PostgreSQL](https://info.crunchydata.com/blog/managing-transaction-id-wraparound-in-postgresql) (2019, Crunchy Data blog)  \n"
View Source
const MSG_RISKS_ARE_HIGH_RECOMMENDATION string = "[P1] To minimize risks of transaction ID wraparound consider the following:  \n" +
	"1. Run `VACUUM FREEZE` for all tables considered as risky (see Observations and Conclusions).  \n" +
	"1. Perform autovacuum tuning to ensure that autovacuum has enough resources and runs often enough to minimize risks of transaction ID wraparound in the future. For more details, read articles provided in  Conclusions. "

Variables

This section is empty.

Functions

func F002PreprocessReportData

func F002PreprocessReportData(data map[string]interface{})

func F002Process

func F002Process(report F002Report) checkup.ReportResult

Generate conclusions and recommendatons

Types

type F002Database

type F002Database struct {
	Num          int     `json:"num"`
	DatabaseName string  `json:"datname"`
	Age          int     `json:"age"`
	CapacityUsed float32 `json:"capacity_used"`
	Datfrozenxid string  `json:"datfrozenxid"`
	Warning      int     `json:"warning"`
}

Instace databases list

type F002Report

type F002Report struct {
	Project       string                  `json:"project"`
	Name          string                  `json:"name"`
	CheckId       string                  `json:"checkId"`
	Timestamptz   string                  `json:"timestamptz"`
	Database      string                  `json:"database"`
	Dependencies  map[string]interface{}  `json:"dependencies"`
	LastNodesJson checkup.ReportLastNodes `json:"last_nodes_json"`
	Results       F002ReportHostsResults  `json:"results"`
}

type F002ReportHostResult

type F002ReportHostResult struct {
	Data      F002ReportHostResultData `json:"data"`
	NodesJson checkup.ReportLastNodes  `json:"nodes.json"`
}

type F002ReportHostResultData

type F002ReportHostResultData struct {
	Databases map[string]F002Database `json:"per_instance"`
	Tables    map[string]F002Table    `json:"per_database"`
}

type F002ReportHostsResults

type F002ReportHostsResults map[string]F002ReportHostResult

type F002Table

type F002Table struct {
	Num                int     `json:"num"`
	Relation           string  `json:"relation"`
	Age                int     `json:"age"`
	CapacityUsed       float32 `json:"capacity_used"`
	RelRelfrozenxid    string  `json:"rel_relfrozenxid"`
	ToastRelfrozenxid  string  `json:"toast_relfrozenxid"`
	Warning            int     `json:"warning"`
	OverriddenSettings bool    `json:"overridden_settings"`
}

Current database tables list

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL