Skip to content

fix converting NULL to uint64 is unsupported in size table#1070

Open
Electronn wants to merge 4 commits intoprometheus-community:masterfrom
Electronn:fix-size-uint64-bug
Open

fix converting NULL to uint64 is unsupported in size table#1070
Electronn wants to merge 4 commits intoprometheus-community:masterfrom
Electronn:fix-size-uint64-bug

Conversation

@Electronn
Copy link
Copy Markdown

This patch fixes bug of unwanted null in uint64 type. Bug causes errors on AWS Aurora PostgreSQL clusters:

Scan error on column index 1, name \"size\": converting NULL to uint64 is unsupported

Signed-off-by: Nikolai Vaganov <electron17@yandex.ru>
Signed-off-by: Nikolai Vaganov <electron17@yandex.ru>
Signed-off-by: Nikolai Vaganov <electron17@yandex.ru>
Comment thread collector/pg_wal.go
return err
}

var segmentsValue float64
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

segments should never be NULL. It's a count(*) which I don't believe can return a NULL value. The error you reported was on the size column. If Aurora is returning NULL for that column, I think there should not be a metric emitted from the exporter. I don't know what value a metric for WAL size with a value of 0 is.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

size is NULL because the number of segments is 0, since the pg_ls_waldir() function in AWS Aurora returns 0 rows. It looks like WAL is implemented differently in Aurora, so this metric does not really make sense there. Possibly a different metric is needed for Aurora.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But the count(*) will still be 0 even with no rows right?

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.

4 participants