database - Can I trust MariaDB Galera cluster unique key -
consider following table structure in mariadb galera cluster:
create table test ( `name` varchar(100) not null, `master` tinyint(1) default null, primary key (`name`), unique key `master` (`master`) ) engine=innodb;
if running on cluster several nodes, , in parallell do:
insert test (name, master) values('node1', 1);
and on node
insert test (name, master) values('node2', 1);
can trust 1 query not replace other?
if both queries ran @ same time, 1 of them still return error?
if query not return error, can trust no other insert can replace row name?
the unique constraint enforced. galera uses optimistic locking , i'm not sure if query gets cluster second return normal duplicate entry error or different error transaction conflict 1 inserted.
Comments
Post a Comment