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

Версия 3.5.2 модуль wal.py нет проверки if not Pooler.in_recovery(): #190

Open
sgrinko opened this issue Sep 13, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@sgrinko
Copy link
Contributor

sgrinko commented Sep 13, 2022

Некоторые функции модуля wal.py не могут быть выполнены на сервере который находится в режиме recovery
В частности: pg_catalog.pg_current_wal_lsn() - выдаёт ошибку
К примеру можно это сделать так:

    def run(self, zbx):

        # count of WAL files
        result = Pooler.run_sql_type("count_wal_files", args=["wal" if Pooler.server_version_greater("10.0") else "xlog"])
        zbx.send(self.key_count_wall.format("[]"), int(result[0][0]))

        if not Pooler.in_recovery():
            if Pooler.server_version_greater("10"):
                result = Pooler.query(self.query_wal_lsn_diff)
                zbx.send(self.key_wall.format("[]"), float(result[0][0]), self.DELTA_SPEED)
            else:
                result = Pooler.query(self.query_xlog_lsn_diff)
                zbx.send(self.key_wall.format("[]"), float(result[0][0]), self.DELTA_SPEED)
...
@cuprumtan
Copy link
Contributor

Добрый день! Добавили фикс в последний релиз.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants