When does INSERT return on a master-master cluster?

22 views
Skip to first unread message

Michael Rommel

unread,
Jun 13, 2021, 11:36:32 AM6/13/21
to codership
Dear all,

we run a galera cluster with 6 masters, configuration of galera looks like this:

[galera]
wsrep_on = ON
wsrep_provider = /usr/lib/libgalera_smm.so
wsrep_cluster_address = "gcomm://10.1.0.4,10.2.0.4,10.3.0.4,10.4.0.4,10.5.0.4,10.6.0.4"
binlog_format = row
default_storage_engine = InnoDB
innodb_autoinc_lock_mode = 2
bind-address = 0.0.0.0

I would like to understand, if we use simple insert into records  (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values (?,?,?,?,?,?,?,?,?)")
statements, is there any possibility to know, when the replication to all other nodes has succeeded? 

I read about Certification based Replication, but there was explicit mentioning of transactions, not simple INSERT statements.

Will the call to INSERT (we will be using node.js and the mysql driver) return as soon as it is sent to the first server or return once all servers received the record?

Is there any setting, that can enforce a synchronous update?

Thanks,

  Michael.

Victor Lindellee

unread,
Jun 14, 2021, 3:31:27 AM6/14/21
to Michael Rommel, codership
Hi Michael!

Have a look at wsrep_sync_wait, I think it will help you forward.

regards
Victor

--
You received this message because you are subscribed to the Google Groups "codership" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codership-tea...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codership-team/f7d914fd-051b-4a95-8ca4-19dbeec1bb9an%40googlegroups.com.

Michael Rommel

unread,
Jun 14, 2021, 6:36:02 AM6/14/21
to codership
Thank you so much, Victor, I don't know, how I could have overlooked that.

For my issue, I would then issue the INSERT statement, then set the sync_wait, issue a read back and then set the sync_wait back to 0. This should solve my problem! Thanks again,

  Michael.

Reply all
Reply to author
Forward
0 new messages