Exclusive mode behavior change from 1.4.199 to 1.4.200

71 views
Skip to first unread message

Matt Pavlovich

unread,
Oct 16, 2019, 12:02:12 PM10/16/19
to H2 Database
With 1.4.200 we noticed that the Exclusive Mode handling changed a bit. A grep of the Change Log didn't bubble anything up.

The behavior now indicates that Exclusive Mode must always go from 0 to 1,2 or 1,2 to 0. 

// 1.4.199
SET EXCLUSIVE 0
SET EXCLUSIVE 0 <-- no exception

SET EXCLUSIVE 1
SET EXCLUSIVE 2 <-- no exception

// 1.4.200
SET EXCLUSIVE 0
SET EXCLUSIVE 0 <-- throws exception

SET EXCLUSIVE 1
SET EXCLUSIVE 2 <-- throws exception

Unit test provided here:

Thanks,
Matt Pavlovich

Andrei Tokar

unread,
Oct 16, 2019, 3:06:57 PM10/16/19
to H2 Database
Although it is a departure from a previous behavior, this is expected, because documentation says:
At the point when test fails, exclusive mode is not set (or rather unset already), hence the failure.

Matt Pavlovich

unread,
Oct 16, 2019, 3:18:54 PM10/16/19
to H2 Database

Andrei Tokar

unread,
Oct 16, 2019, 3:31:16 PM10/16/19
to H2 Database
I know, I've read and run it, but my point is - it's not the connection that set exclusive mode, because there is none, exclusive mode is not set at all.

Matt Pavlovich

unread,
Oct 16, 2019, 3:44:26 PM10/16/19
to H2 Database
Andrei-

Thank you for the quick response. Can you elaborate on the thought process about why going from 1 to 2 would throw the same error?

Prior to 1.4.200 we used a progression of EXCLUSIVE settings:

a. Don't allow new connections (ie allow connections to natural quiesce)
     SET EXCLUSIVE 1

b. After a period of time .. drop all connections (ie.. any remaining connections are not going to quiesce, so let's disconnect all)
     SET EXCLUSIVE 2

c. Do administrative tasks..

d. Allow connections to resume..
     SET EXCLUSIVE 0

Thanks,
Matt

Andrei Tokar

unread,
Oct 16, 2019, 4:44:48 PM10/16/19
to H2 Database
I won't even try to defend this one. It is a bug, and fix is here.

Matt Pavlovich

unread,
Oct 16, 2019, 5:23:39 PM10/16/19
to H2 Database
Awesome, man. Thank you!  I've previously submitted H2 code contributions. Feel free to incorporate the unit tests as you see fit.

Sofiane CHELABI

unread,
Oct 17, 2019, 3:23:01 AM10/17/19
to H2 Database
Thank you Matt for this information.
Do you have an idea of ​​the release date of version 1.4.200 ?

Best regards
Reply all
Reply to author
Forward
0 new messages