mariadb galera群集:选择为什么不锁定?

6ie5vjzr  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(254)

为什么mariadb galera集群10.2.11的2个节点之间的记录没有锁定?

Node 1                                        Node 2

START TRANSACTION;
SELECT * FROM table WHERE id = 1 FOR UPDATE;
+----+------+
| id | info |
+----+------+
|  1 | 123  |
+----+------+

                                              START TRANSACTION;
                                              SELECT * FROM table WHERE id = 1 FOR UPDATE;
                                              +----+------+
                                              | id | info |
                                              +----+------+
                                              |  1 | 123  |
                                              +----+------+

如果我在一个节点中通过两个连接来尝试这一点-锁定是可以的。
我的服务器配置(/etc/my.cnf.d/server.cnf)

[server]

[mysqld]
log_bin = prod-bin
sql_mode = STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
transaction-isolation = READ-COMMITTED
slow_query_log = ON
slow_launch_time = 2
innodb_buffer_pool_size=3G
expire_logs_days = 30
auto_increment_increment = 3
auto_increment_offset = 2
sql_error_log_rotate = TRUE
max_connections = 2000

[galera]
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://192.168.0.102,192.168.0.80,192.168.0.23
wsrep_cluster_name="cluster"
wsrep_sst_method=xtrabackup
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2

[embedded]

[mariadb]

[mariadb-10.1]

谢谢您。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题