public inbox for [email protected]
help / color / mirror / Atom feed patroni debian bullseye package file inconsistency
2+ messages / 2 participants
[nested] [flat]
* patroni debian bullseye package file inconsistency
@ 2022-04-27 11:37 Kirill <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Kirill @ 2022-04-27 11:37 UTC (permalink / raw)
To: [email protected]
Hello, community!
First of all, thanks for fast version releases of patroni package.
I am using that package:
$ apt-cache policy patroni
patroni:
Installed: 2.1.3-2.pgdg110+1
Candidate: 2.1.3-2.pgdg110+1
Version table:
*** 2.1.3-2.pgdg110+1 500
500 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 Packages
100 /var/lib/dpkg/status
During the usage of patroni I got an error:
$ patroni --version
patroni 2.1.3
$ patroni --validate-config /etc/patroni-server/config.yaml
...
Traceback (most recent call last):
File "/usr/bin/patroni", line 33, in <module>
sys.exit(load_entry_point('patroni==2.1.3', 'console_scripts', 'patroni')())
File "/usr/lib/python3/dist-packages/patroni/__main__.py", line 143, in main
return patroni_main()
File "/usr/lib/python3/dist-packages/patroni/__main__.py", line 135, in patroni_main
abstract_main(Patroni, schema)
File "/usr/lib/python3/dist-packages/patroni/daemon.py", line 88, in abstract_main
Config(args.configfile, validator=validator)
File "/usr/lib/python3/dist-packages/patroni/config.py", line 105, in __init__
error = validator(self._local_configuration)
File "/usr/lib/python3/dist-packages/patroni/validator.py", line 177, in __call__
for i in self.validate(data):
File "/usr/lib/python3/dist-packages/patroni/validator.py", line 209, in validate
for i in self.iter():
File "/usr/lib/python3/dist-packages/patroni/validator.py", line 217, in iter
for i in self.iter_dict():
File "/usr/lib/python3/dist-packages/patroni/validator.py", line 244, in iter_dict
validator = self.validator[key]._schema[d]
KeyError: 'etcd3'
I started to investigate and found that actual file:
$ dpkg -S /usr/lib/python3/dist-packages/patroni/validator.py
patroni: /usr/lib/python3/dist-packages/patroni/validator.py
is different from source file:
$ git clone https://github.com/zalando/patroni.git
$ cd patroni/
$ git checkout v2.1.3
$ diff patroni/validator.py /usr/lib/python3/dist-packages/patroni/validator.py
56,60d55
< def validate_host_port_list(value):
< assert all([validate_host_port(v) for v in value]), "didn't pass the validation"
< return True
<
<
62c57,58
< return validate_host_port_list([s.strip() for s in string.split(",")])
---
> assert all([validate_host_port(s.strip()) for s in string.split(",")]), "didn't pass the validation"
> return True
298d293
< validate_host_port_list.expected_type = list
304,312d298
< validate_etcd = {
< Or("host", "hosts", "srv", "srv_suffix", "url", "proxy"): Case({
< "host": validate_host_port,
< "hosts": Or(comma_separated_host_port, [validate_host_port]),
< "srv": str,
< "srv_suffix": str,
< "url": str,
< "proxy": str})
< }
337,338c323,330
< "etcd": validate_etcd,
< "etcd3": validate_etcd,
---
> "etcd": {
> Or("host", "hosts", "srv", "url", "proxy"): Case({
> "host": validate_host_port,
> "hosts": Or(comma_separated_host_port, [validate_host_port]),
> "srv": str,
> "url": str,
> "proxy": str})
So my question — is it intended inconsistency or just a bug?
i will appreciate to any feedback. Thanks!
---
Kirill Petrov
https://github.com/chobostar
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: patroni debian bullseye package file inconsistency
@ 2022-04-29 16:05 Michael Banck <[email protected]>
parent: Kirill <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Michael Banck @ 2022-04-29 16:05 UTC (permalink / raw)
To: Kirill <[email protected]>; +Cc: [email protected]
Hi,
(I'm not on pgsql-pkg-debian, somebody forwarded me your mail)
On Wed, Apr 27, 2022 at 02:37:34PM +0300, Kirill wrote:
> I am using that package:
>
> $ apt-cache policy patroni
> patroni:
> Installed: 2.1.3-2.pgdg110+1
> Candidate: 2.1.3-2.pgdg110+1
> Version table:
> *** 2.1.3-2.pgdg110+1 500
> 500 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 Packages
> 100 /var/lib/dpkg/status
>
> During the usage of patroni I got an error:
>
> $ patroni --validate-config /etc/patroni-server/config.yaml
[...]
> Traceback (most recent call last):
[...]
> File "/usr/lib/python3/dist-packages/patroni/validator.py", line 244, in iter_dict
> validator = self.validator[key]._schema[d]
> KeyError: 'etcd3'
Apparently, running --validate-config on a config using etc3 has been
broken for quite a long time, and nobody noticed.
> I started to investigate and found that actual file:
>
> $ dpkg -S /usr/lib/python3/dist-packages/patroni/validator.py
> patroni: /usr/lib/python3/dist-packages/patroni/validator.py
>
> is different from source file:
This is because there is a Debian patch that reverts an upstream change
that adds some RAFT tests which (as Debian does not ship RAFT yet) when
run would make the testsuite fail:
https://salsa.debian.org/postgresql/patroni/-/blob/debian/2.1.3-2/debian/patches/regression_tests_di...
However, that upstream change we reverted also added etcd3 validation,
which is what is now missing for you.
I've reworked the patch[1] so that only the RAFT-specifc changes remain,
and in my testing the above traceback is gone.
I will upload it once CI passes.
Michael
[1] https://salsa.debian.org/postgresql/patroni/-/commit/538cc5f0f9d6bd1704513f7280a0fd35cd193edf
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-04-29 16:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 11:37 patroni debian bullseye package file inconsistency Kirill <[email protected]>
2022-04-29 16:05 ` Michael Banck <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox