GithubHelp home page GithubHelp logo

pg_statsinfo's Issues

pg_statsinfo.long_lock_thresholdについて

ドキュメントのConfiguration in postgresql.confに従ってlong_lock_threshold = 30sと設定したところ、
エラーが発生しサーバーが起動できませんでした。
long_lock_threshold = 30と単位を付けず指定すると起動に成功しました。
long_lock_thresholdは単位を指定してはいけないのですか。
もし単位を指定してはいけない場合、Configuration in postgresql.confではなぜ以下のように単位「s」が付いているのでしょうか?

#pg_statsinfo.long_lock_threshold = 30s        # threshold for getting long lock information

About Japanese support for pg_statsinfo.

Hello, I will use pg_statsinfo on PostgreSQL16.

In the Configuration File section of pg_statsinfo.md, it's written that lc_messages must be C.
I think this explanation means that pg_statsinfo does not support Japanese in pg_statsinfo v16.0.
If this understanding is incorrect, please tell me why did you make this change?

Below is request from user.
Please write lc_messages must be C on relese notes and the section of "Changes from pg_statsinfo15" in pg_statsinfo.md.
And, I cannot notice that we need to create /run/pg_statsinfo directory, so please add it in the same place.

ドキュメントの pg_statsinfo.rusage_track のデフォルト値誤り

pg_statsinfo/doc/pg_statsinfo-ja.md の追加設定項目にある設定項目 pg_statsinfo.rusage_track のデフォルト値は 'on' となっていますがこれは誤りで、ソースコードで設定されているデフォルト値は 'top' となっています。

https://github.com/ossc-db/pg_statsinfo/blob/main/doc/pg_statsinfo-ja.md#%E8%BF%BD%E5%8A%A0%E8%A8%AD%E5%AE%9A%E9%A0%85%E7%9B%AE

また、取り得る値(設定可能な値)は 'top', 'all', 'none' で、デフォルト値の 'on' を設定すると下記のエラーが出ます。'off' を設定しても同じエラーとなります。

WARNING: 22023: invalid value for parameter "pg_statsinfo.rusage_track": "on"
HINT: Available values: none, top, all.

デフォルト値を 'top' に訂正することと、説明に取り得る設定値('top', 'all', 'none')と、それぞれの設定値の説明の追加をお願いします。

compilation errors on Ubuntu 22.04

o/

I'am install postgresql-14 and all dev packages from default repository.
But i get compilation errors.

# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

# apt search postgresql-server-dev-all
Sorting... Done
Full Text Search... Done
postgresql-server-dev-all/jammy,now 238 amd64 [installed]
extension build tool for multiple PostgreSQL versions

# make USE_PGXS=1
---snipped---
make[1]: Entering directory '/root/pg_statsinfo/agent'
make[2]: Entering directory '/root/pg_statsinfo/agent/bin'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer pg_statsinfod.o autovacuum.o checkpoint.o collector.o collector_wait_sampling.o logger.o logger_send.o logger_common.o logger_in.o logger_out.o maintenance.o snapshot.o writer.o pg_control.o pgut/pgut.o pgut/pgut-list.o pgut/pgut-pthread.o -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-14/lib -Wl,--as-needed -L/usr/lib/x86_64-linux-gnu -lpq -lpthread -lpgcommon -lpgport -o pg_statsinfod
/usr/bin/ld: cannot find -lpgcommon: No such file or directory
/usr/bin/ld: cannot find -lpgport: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [/usr/lib/postgresql/14/lib/pgxs/src/makefiles/pgxs.mk:475: pg_statsinfod] Error 1
make[2]: Leaving directory '/root/pg_statsinfo/agent/bin'
make[1]: *** [Makefile:9: all] Error 2
make[1]: Leaving directory '/root/pg_statsinfo/agent'
make: *** [Makefile:36: all] Error 2

libpgcommon.a and libpgport.a libraries are static and presents, but i'am not find headers files for them.

pg_stats_reporter and pg_store_plans compile without problems.
what am I doing wrong ?

thank you very much!

ERROR: pg_statsinfo: incompatible statsrepo schema: version mismatchの対応方法について

環境:

OS:RHEL 8.6
ソフトウェア:
PostgreSQL 14.4
パッケージ:
pg_statinfo14.0

当方環境でpg_statinfo14.0 -> 14.2のアップグレードを下記の手順で行いました。

  1. postgresql.conf の shared_preload_libraries から pg_statsinfo を取り除き、全ての pg_statsinfo.* パラメータを削除(コメントアウト)した後に、PostgreSQL を再起動します。

  2. rootユーザーでパッケージを更新します。
    rpm -Uvh pg_statsinfo-14.2-1.rhel8.x86_64.rpm

  3. 設定ファイルに shared_preload_libraries = 'pg_statsinfo' と pg_statsinfo.* パラメータを再度有効にして、開始対象側 PostgreSQL を再起動します。

しかし、その後、手動・自動 snapshot がどちらも取得できなくなっています。
ログは下記のようです。

2023-08-03 03:17:11 EDT 4589 64cb5477.11ed-1 0 LOG:  pg_statsinfo launcher started
2023-08-03 03:17:11 EDT 4591 -  (pg_statsinfod, , , pg_statsinfod) LOG:  pg_statsinfo: start
2023-08-03 03:17:11 EDT 4591 -  (pg_statsinfod, , , pg_statsinfod) ERROR:  pg_statsinfo: pg_statsinfo.control format incompatible
2023-08-03 03:17:11 EDT 4591 -  (pg_statsinfod, , , pg_statsinfod) DETAIL:  pg_statsinfo.control was created with STATSINFO_CONTROL_VERSION 140000 (0x000222e0), but the pg_statsinfo was compiled with STATSINFO_CONTROL_VERSION 140200 (0x000223a8)
2023-08-03 03:17:11 EDT 4591 -  (pg_statsinfod, , , pg_statsinfod) ERROR:  pg_statsinfo: incompatible statsrepo schema: version mismatch
2023-08-03 03:17:11 EDT 4591 -  (pg_statsinfod, , , pg_statsinfod) LOG:  pg_statsinfo: pg_statsinfo is starting in fallback mode
2023-08-03 03:17:11 EDT 4591 -  (pg_statsinfod, , , pg_statsinfod) WARNING:  pg_statsinfo: writer discards 1 items
2023-08-03 03:18:48 EDT 4591 -  (pg_statsinfod, , , pg_statsinfod) WARNING:  pg_statsinfo: writer discards 1 items

検証して出た上記のメッセージ「ERROR: pg_statsinfo: incompatible statsrepo schema: version mismatch」を見ると、
古いデータは削除する必要がある(マイナーバージョンアップでも互換性は無い)ように思います。
つまり、アップグレード後にスキーマの作り直しが必要あります。

公式のpg_statsinfo (14 ~)キュメントのフォールバックモードの説明によると、
リポジトリDBの復旧に関する点検事項と対処方法を次のように示しています。

・リポジトリDBに接続できない場合
 statsrepo スキーマのバージョンが合わない場合
 (正しいバージョンの statsrepo スキーマは設定リロード時に自動的に登録されます)

https://github.com/ossc-db/pg_statsinfo/blob/main/doc/pg_statsinfo-ja.md#%E3%83%95%E3%82%A9%E3%83%BC%E3%83%AB[…]%E3%82%AF%E3%83%A2%E3%83%BC%E3%83%89

pg_statsinfo (~ 13)以前の場合、次のように示しています。

リポジトリDBに接続できない場合
・リポジトリDBの稼動状態を確認し、リポジトリDBが停止している場合はリポジトリDBを起動してください。
・設定ファイルのリポジトリDBへの接続文字列(pg_statsinfo.repository_server)を確認し、設定が誤っている場合は修正してください。(要設定リロード)
statsrepo スキーマのバージョンが合わない場合
・statsrepo スキーマを削除するか、リポジトリDBのデータベースを別に作成してください。
 (正しいバージョンの statsrepo スキーマは設定リロード時に自動的に登録されます)

https://pgstatsinfo.sourceforge.net/documents/statsinfo13/pg_statsinfo-ja.html#fallback-mode

ただし、今回の事象からみると、pg_statsinfo (14 ~)の場合も、バージョンが合わないとスキーマを削除する必要があると考えていますので、報告します。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.