mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-24 07:36:30 +00:00
Compare commits
1 Commits
dev/remove
...
dev/gianni
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d52b045113 |
37
.github/workflows/sonarqube-scan.yml
vendored
Normal file
37
.github/workflows/sonarqube-scan.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: SonarQube Scan
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
sonarQube:
|
||||||
|
name: SonarQube-Job
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout source repo
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
ref: '${{ github.head_ref }}'
|
||||||
|
|
||||||
|
- name: Checkout GitHub Action Repo
|
||||||
|
uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
repository: EnterpriseDB/edb-github-actions.git
|
||||||
|
ref: master
|
||||||
|
token: ${{ secrets.GH_SLONIK }}
|
||||||
|
path: .github/actions/edb-github-actions
|
||||||
|
|
||||||
|
- name: SonarQube Scan
|
||||||
|
uses: ./.github/actions/edb-github-actions/sonarqube
|
||||||
|
with:
|
||||||
|
REPO_NAME: '${{github.event.repository.name}}'
|
||||||
|
SONAR_PROJECT_KEY: EnterpriseDB_repmgr
|
||||||
|
SONAR_URL: '${{secrets.SONARQUBE_URL}}'
|
||||||
|
SONAR_LOGIN: '${{secrets.SONARQUBE_LOGIN}}'
|
||||||
|
PULL_REQUEST_KEY: '${{github.event.number}}'
|
||||||
|
PULL_REQUEST_BRANCH: '${{github.head_ref}}'
|
||||||
|
PULL_REQUEST_BASE_BRANCH: '${{github.base_ref}}'
|
||||||
|
REPO_DEFAULT_BRANCH: '${{github.event.repository.default_branch}}'
|
||||||
|
REPO_EXCLUDE_FILES: '*properties*,**/src/test/**/*,**/*.sql,**/docs/**/*,**/*/*.java'
|
||||||
18
.github/workflows/sonarqube/configure-env.sh
vendored
Executable file
18
.github/workflows/sonarqube/configure-env.sh
vendored
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install debhelper curl autoconf zlib1g-dev \
|
||||||
|
libedit-dev libxml2-dev libxslt1-dev libkrb5-dev libssl-dev libpam0g-dev systemtap-sdt-dev \
|
||||||
|
libselinux1-dev build-essential bison apt-utils lsb-release devscripts \
|
||||||
|
software-properties-common git shellcheck flex
|
||||||
|
|
||||||
|
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
||||||
|
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
||||||
|
sudo apt-get update
|
||||||
|
|
||||||
|
sudo apt-get -y install libpq-dev postgresql-13 postgresql-server-dev-13
|
||||||
|
|
||||||
|
./configure
|
||||||
|
|
||||||
|
export PG_CONFIG=/usr/bin/pg_config
|
||||||
|
|
||||||
|
/home/buildfarm/sonar/depends/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory make
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<simpara>
|
<simpara>
|
||||||
option to execute custom scripts ("<link linkend="event-notifications">event notifications</link>")
|
option to execute custom scripts ("<link linkend="event-notifications">event notifications</link>
|
||||||
at different points in the failover sequence
|
at different points in the failover sequence
|
||||||
</simpara>
|
</simpara>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -19,6 +19,77 @@
|
|||||||
#ifndef _REPMGR_ACTION_STANDBY_H_
|
#ifndef _REPMGR_ACTION_STANDBY_H_
|
||||||
#define _REPMGR_ACTION_STANDBY_H_
|
#define _REPMGR_ACTION_STANDBY_H_
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int reachable_sibling_node_count;
|
||||||
|
int reachable_sibling_nodes_with_slot_count;
|
||||||
|
int unreachable_sibling_node_count;
|
||||||
|
int min_required_wal_senders;
|
||||||
|
int min_required_free_slots;
|
||||||
|
} SiblingNodeStats;
|
||||||
|
|
||||||
|
#define T_SIBLING_NODES_STATS_INITIALIZER { \
|
||||||
|
0, \
|
||||||
|
0, \
|
||||||
|
0, \
|
||||||
|
0, \
|
||||||
|
0 \
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
RepmgrdInfo **repmgrd_info;
|
||||||
|
int repmgrd_running_count;
|
||||||
|
|
||||||
|
bool dry_run_success;
|
||||||
|
|
||||||
|
/* store list of configuration files on the demotion candidate */
|
||||||
|
KeyValueList remote_config_files;
|
||||||
|
|
||||||
|
/* used for handling repmgrd pause/unpause */
|
||||||
|
NodeInfoList all_nodes;
|
||||||
|
|
||||||
|
NodeInfoList sibling_nodes;
|
||||||
|
SiblingNodeStats sibling_nodes_stats;
|
||||||
|
|
||||||
|
t_event_info event_info;
|
||||||
|
int remote_node_id;
|
||||||
|
t_node_info remote_node_record;
|
||||||
|
t_node_info local_node_record;
|
||||||
|
char remote_conninfo[MAXCONNINFO];
|
||||||
|
bool switchover_success;
|
||||||
|
RecoveryType recovery_type;
|
||||||
|
PGconn *superuser_conn;
|
||||||
|
|
||||||
|
/* the remote server is the primary to be demoted */
|
||||||
|
char remote_host[MAXLEN];
|
||||||
|
int remote_repmgr_version;
|
||||||
|
PGconn *remote_conn;
|
||||||
|
PGconn *local_conn;
|
||||||
|
} t_standby_switchover_rec;
|
||||||
|
|
||||||
|
#define T_STANDBY_SWITCHOVER_INITIALIZER { \
|
||||||
|
NULL, \
|
||||||
|
true, \
|
||||||
|
{NULL, NULL}, \
|
||||||
|
T_NODE_INFO_LIST_INITIALIZER, \
|
||||||
|
T_NODE_INFO_LIST_INITIALIZER, \
|
||||||
|
T_SIBLING_NODES_STATS_INITIALIZER, \
|
||||||
|
T_EVENT_INFO_INITIALIZER, \
|
||||||
|
UNKNOWN_NODE_ID, \
|
||||||
|
T_NODE_INFO_INITIALIZER, \
|
||||||
|
T_NODE_INFO_INITIALIZER, \
|
||||||
|
"", \
|
||||||
|
true, \
|
||||||
|
RECTYPE_UNKNOWN, \
|
||||||
|
NULL, \
|
||||||
|
"", \
|
||||||
|
UNKNOWN_REPMGR_VERSION_NUM, \
|
||||||
|
NULL, \
|
||||||
|
NULL \
|
||||||
|
}
|
||||||
|
|
||||||
extern void do_standby_clone(void);
|
extern void do_standby_clone(void);
|
||||||
extern void do_standby_register(void);
|
extern void do_standby_register(void);
|
||||||
extern void do_standby_unregister(void);
|
extern void do_standby_unregister(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user