sorintlab / stolon

PostgreSQL cloud native High Availability and more.
https://talk.stolon.io
Apache License 2.0
4.66k stars 447 forks source link

To provide feedback when patching using stolonctl #825

Open viggy28 opened 3 years ago

viggy28 commented 3 years ago

What would you like to be added: Currently, if we patch anything using stolonctl, we receive a response only if there is any error in the command.

For eg:

stolonctl --cluster-name stolon-cluster --store-backend=etcdv3 update -p '{"pgParameters:{"wal_keep_segments":"12000"}}'
failed to patch cluster spec: failed to merge patch cluster spec: invalid JSON document

As you can see keyword pgParameters is missing " and there is a response that the patch is failed.

However, if you do

stolonctl --cluster-name stolon-cluster --store-backend=etcdv3 update -p '{"wal_keep_segments":"12000"}'

No response, since there is no known spec called wal_keep_segments. Clearly, this should be nested inside pgParameters.

Why is this needed: I know it's not a requirement, but it would be nice to let a user know when they make a mistake on the spec update. (I spent 20 minutes debugging :) )