From c83427521aa4e0f092c5fe4c596d112f6a35018e Mon Sep 17 00:00:00 2001 From: Ashraful Haque Tani <48568933+AshrafulHaqueToni@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:25:53 +0600 Subject: [PATCH] Add Multi Primary Support for V8.4.2 (#41) * Add Multi Primary Support Signed-off-by: raihankhan Co-authored-by: raihankhan --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++ scripts/run.sh | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ac8c0d4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + pull_request: + branches: + - "*" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-ci + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v1 + + - name: Print version info + id: semver + run: | + make version + + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build + run: | + make container \ No newline at end of file diff --git a/scripts/run.sh b/scripts/run.sh index 3155a5f..1a1e10e 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -13,6 +13,7 @@ # HOST_ADDRESS_TYPE = Address type of HOST_ADDRESS (one of DNS, IPV4, IPv6) # POD_IP = IP address used to create whitelist CIDR. For HOST_ADDRESS_TYPE=DNS, it will be status.PodIP. # POD_IP_TYPE = Address type of POD_IP (one of IPV4, IPv6) +# PRIMARY_TYPE = defines single/multi primary env | sort | grep "POD\|HOST\|NAME" @@ -104,6 +105,49 @@ mkdir -p /etc/mysql/group-replication.conf.d/ echo "!includedir /etc/mysql/group-replication.conf.d/" >>/etc/mysql/my.cnf mkdir -p /etc/mysql/conf.d/ echo "!includedir /etc/mysql/conf.d/" >>/etc/mysql/my.cnf +if [[ "$PRIMARY_TYPE" == "Multi-Primary" ]]; then +cat >>/etc/mysql/group-replication.conf.d/group.cnf <>/etc/mysql/group-replication.conf.d/group.cnf <