PostgreSQL 12 changed how it manages recovery and standby:
* The "recovery.conf" file has been removed.
* Recovery parameters now live in "postgresql.conf"
* "standby_mode" recovery parameter has been removed.
* Two "signal" files ("recovery.signal" and "standby.signal") are used to define
the recovery mode (instead of using a "recovery.conf" file + "standby_mode" parameter)
Implement initial run definition for agola CI/CD. It'll use the latest two go
versions (currently 1.12 and 1.13)
Add a test matrix for all the supported postgres version and stores (for etcdv2
and consul just test with the latest postgres version)
In future will add automatic docker example image build and push
* use go 1.10.x and 1.11.x on travis
* Remove the build hack that uses a local GOPATH:
* Use `go_import_path` on travis and create a symlink to the main org repo on
semaphore
* Users forking stolon repo on github should just use git remotes in the main
repo clone
* Remove messages to build a cgo enabled stdlib, go build cache introduced in go
1.10 also caches this.
* Always use `go build` instead of `go install` so we can directly place
binaries in the project bin dir and choose the binary name
Temporarily disable gofmt on CI since it'll break when we'll use go 1.10 and go
1.11.
A possible solution could be to check against only one (usually the latest
stable) go version gofmt output (for example gofmt in go 1.10 and 1.11 will
format differently) or check that at least one passes.
for etcdv2 and consul we keep using libkv while for etcd v3 api we'll directly
use the etcdclientv3. We abstract the implementation under a KVStore and an
Election interface. We haven't implemented a libkv store for etcdv3 since libkv
looks quite dead and doesn't support the context package. So in future we'll
probably move out from libkv to better use context features.
The keeper and db states are reported using the store.
The keeper doesn't listen on a tcp port anymore since there isn't the
need to expose an api to query its state. The related options have been
removed (--port and --listen-address).
In addition, the kubernetes discovery has been removed since everything
is done using the store. The kubernetes discovery was quite complicated
and probably useful only for having the pod list from k8s and skip old
partitioned pods able to talk with the store. Probably this case is very
special and doesn't requires this sort of handling and can be generally
improved in future with additional checks (as a last resort a check that
does a k8s based filtering could be implemented).
Also the related sentinel options have been removed.
Don't move previous postgresql.conf but start instance with a temporary
config file.
Save locally init parameters so they can be restored if the keeper is
restarted before the sentinel has moved the cluster status to normal
phase.
Use pg_file_settings when available (pg >= 9.5) to retrieve pg
parameters.
Improve and add tests.
Previously when switching an instance from master to standby role, a
full resync was always executed.
Sometimes an old master is on the same branch of the new one and can
become a standby without the need to full resync.
since some integration tests are quite long (minutes), run them in
parallel.
To avoid unreadable logging (due multiple tests running in parallel),
use only the `testing` pkg logging functions so the output will be shown
only on error or at the end of every test (since we pass `-v` to `go
test`).
By default 4 parallel tests will be run. The parallelism level can be
configured with the PARALLEL environment variable when invoking the test
script.
This patch uses docker/libkv and swarm/leadership to also handle consul as a
stolon's store.
In future also zookeeper should be supported (needs testing).
Incompatible changes:
--etcd-endpoints option has been removed
--store-backend and --store-endpoints options has been added.
Now users can define in the cluster config if they want synchronous
replication. When enabled the master server parameter `synchronous_standby_names`
will be set to the value of the followers defined in the cluster view.
Users can switch between async and sync replication at any time without the
need to restart anything.