HAProxy with 2 Master

179 views
Skip to first unread message

Sassy Natan

unread,
Feb 2, 2023, 6:45:27 AM2/2/23
to Repo and Gerrit Discussion
Hi Group,
Quick question with your permission:

I have troubles to understand how HAProxy and Gerrit can work in a Multi Master Topology without having a SHA conflicts.

For example:
I have HAProxy (Hostname: HAProxy) and 2 Gerrit Servers (Gerrit Node 01 and Gerrit Node 02)

The HAProxy is configure as both L7 (HTTPS) and L4 (SSH).

The HAProxy config is based on the following config:
Where there are two approaches:
1. Active/Passive
2. Active/Active

However the Active/Active configuration present is not a real active active, because with a write operation the:

1. HAProxy always route the traffic to a single master server when a POST command present in the HTTP Headers (L7).
2. HAproxy always router the traffic to a single master with L4 (SSH).

It is true that with HTTP(L7) the HAProxy can router traffic to other slaves but this is only for READ operations. With HTTP(L4) the HAProxy always hit the Main Server(even for read operations).

The high-availability plugin do explain how to setup Multi Master Topology but does not explain how the configuration in Multi-Master Configuration doc (where there is not BACKUP declaration in the HAProxy) not fails to have SHA conflicts if multi commits enter to the gerrit in the same time.

To my understanding a REAL Mutli Master requires gerrit v3.3 or later with the global-refdb within the same site as explain in multi-site.

I would be happy if someone can clarified this. 

P.S. Will it be wise to enforce HTTP mode only without SSH? 

Thank You
Sassy

Matthias Sohn

unread,
Feb 2, 2023, 8:08:35 AM2/2/23
to Sassy Natan, Repo and Gerrit Discussion
On Thu, Feb 2, 2023 at 12:45 PM Sassy Natan <sas...@gmail.com> wrote:
Hi Group,
Quick question with your permission:

you don't need to ask for our permission to ask questions, this list is here to ask questions :-) 

I have troubles to understand how HAProxy and Gerrit can work in a Multi Master Topology without having a SHA conflicts.

Which multi-master topology are you referring to? Using high-availability plugin, multi-site plugin and friends or something else ?
What do you mean by SHA conflict ? 

For example:
I have HAProxy (Hostname: HAProxy) and 2 Gerrit Servers (Gerrit Node 01 and Gerrit Node 02)

The HAProxy is configure as both L7 (HTTPS) and L4 (SSH).

The HAProxy config is based on the following config:
Where there are two approaches:
1. Active/Passive
2. Active/Active

However the Active/Active configuration present is not a real active active, because with a write operation the:

1. HAProxy always route the traffic to a single master server when a POST command present in the HTTP Headers (L7).
2. HAproxy always router the traffic to a single master with L4 (SSH).

It is true that with HTTP(L7) the HAProxy can router traffic to other slaves but this is only for READ operations. With HTTP(L4) the HAProxy always hit the Main Server(even for read operations).

I don't understand which topology you are looking at here, above you talk about active/active but here you mention slaves (we call them replica today)
 
The high-availability plugin do explain how to setup Multi Master Topology but does not explain how the configuration in Multi-Master Configuration doc (where there is not BACKUP declaration in the HAProxy) not fails to have SHA conflicts if multi commits enter to the gerrit in the same time.

AFAIK the high-availability plugin requires shared storage for git repositories and websession storage between the nodes.
The multi-master plugin is very outdated (last change 10 years ago) and doesn't work with any supported Gerrit versions.


To my understanding a REAL Mutli Master requires gerrit v3.3 or later with the global-refdb within the same site as explain in multi-site.

If you want active/active with high-availability plugin or multi-site setup you need a global-refdb implementation.
 
I would be happy if someone can clarified this. 

P.S. Will it be wise to enforce HTTP mode only without SSH? 

Thank You
Sassy

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/9be6641a-3899-407a-8dce-52a5920e9336n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages