@Sergey_DSV
- Is it correct or safe to have the same server_id on all nodes in a Galera cluster?
It’s totally fine. PXC/Galera uses its own certification-based replication to interact and sync changes rather the the binary logs.
Are you using it for performing any non-Galera-based writes or any kind of multi-source replication on any of the Galera nodes?
Since you are using a MariaDB cluster, let me add the MariaDB manual, which clearly explains the use of server_id in Galera-based setups. I am sure this clears your doubt.
- Is it a valid approach to assign different gtid_domain_id values per node in this setup?
Yes, it’s fine to have a different gtid_domain_id. This prevents the node from using the same domain as Galera-based write sets when assigning GTIDs to non-Galera transactions.
On the other hand, wsrep_gtid_domain_id should be the same across all nodes within a cluster so that each node uses the same domain when assigning GTIDs for Galera Cluster-based write sets.
Reference - Using MariaDB GTIDs with MariaDB Galera Cluster | Galera Cluster | MariaDB Documentation
- What potential problems or risks could arise from this configuration, especially regarding
replication and failover?
To ensure the async replica applies all change streams, it is recommended to enable [log_slave_updates/log_replica_updates] on the Galera cluster so binary logs contain all GTID sets. gtid_domain_id is already set with a different value on all 3 nodes, so the TRX origin can still be identified and differentiated.
How exactly are your async nodes connected? Are they always connected to a dedicated Galera node, or do they have some failover there to switch between galera nodes ?
- Could this setup lead to conflicts, data inconsistency, or issues with GTID-based replication in the future?
As mentioned, there are some edge case/requirement- Using MariaDB Replication with MariaDB Galera Cluster | Galera Cluster | MariaDB Documentation where having different server-id make sense. You can verify the same if using or not.
I don’t see any other issue.
Further, can you please clarify how exactly your external replicas are connected to the Galera cluster ? Is there any multi-source replication kind of topology also used in this ? Are you using GTID or file/position-based replication?
Please share your Galera/Async configuration file also.