Skip to content

Instantly share code, notes, and snippets.

Oleksii Kliukin alexeyklyukin

Block or report user

Report or block alexeyklyukin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pg_repack_evaluation.md

Intro

pg_repack is a well-known tool to perform online cluster or vacuum on one or more target tables without locking them for concurrent readers and writers. Below is the description of its inner working obtained by reading the source code; it is followed by the risk assessment.

Process

View tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"options": {
"cwd": "${workspaceRoot}/../../../build/pg/master/",
"env": {
"CPPFLAGS": "-I/usr/local/opt/openssl/include",
"LDFLAGS": "-L/usr/local/opt/openssl/lib",
"CFLAGS": "-ggdb -Og -g3 -fno-omit-frame-pointer"
@alexeyklyukin
alexeyklyukin / gist:0227addac5f30f80feea616f459bfa4c
Created Feb 13, 2018
Spilo configuration environment variable
View gist:0227addac5f30f80feea616f459bfa4c
SPILO_CONFIGURATION: | ## https://github.com/zalando/patroni#yaml-configuration
tags:
clonefrom: true
postgresql:
bin_dir: /usr/lib/postgresql/9.6/bin
bootstrap:
initdb:
- auth-host: md5
- auth-local: trust
pg_hba:
View gist:6b84df0c129216ba15e43d0421daed20
python3 ./patronictl.py -c postgres0.yml list batman
+---------+-------------+-----------+--------+---------+-----------+---------------------------------------------+
| Cluster | Member | Host | Role | State | Lag in MB | Scheduled restart |
+---------+-------------+-----------+--------+---------+-----------+---------------------------------------------+
| batman | postgresql0 | 127.0.0.1 | Leader | running | 0 | 2017-12-05T14:30:00+01:00 if version < 10.1 |
| batman | postgresql1 | 127.0.0.1 | | running | unknown | |
+---------+-------------+-----------+--------+---------+-----------+---------------------------------------------+
etcdctl get /service/batman/optime/leader
50332128
You can’t perform that action at this time.