-
-
Notifications
You must be signed in to change notification settings - Fork 265
Description
Issue:
G2 anti dependency anomaly detected with Firebird 4.0 when transactions are executed under snapshot table stability isolation level. Transactions are not serializable.
Firebird version used: 4.0
Client used: isql
Steps to reproduce
Table setup:
CREATE TABLE main(key varchar(99),value_store varchar(99),second_key varchar(99),PRIMARY KEY (key));
CREATE TABLE second_table(key varchar(99),value_store varchar(99),second_key varchar(99),PRIMARY KEY (key));
Start three instances of isql. Let's call them C1, C2 and C3. All commands with suffix C1 are run on client 1 and C2 on 2 and so on. The order in which the steps are presented would be the order of execution of the commands.
C1: SET TRANSACTION READ WRITE WAIT ISOLATION LEVEL SNAPSHOT TABLE STABILITY;
C1: INSERT INTO second_table (key,second_key,value_store) VALUES ('1', '1','1');
C2: SET TRANSACTION READ WRITE WAIT ISOLATION LEVEL SNAPSHOT TABLE STABILITY;
C2: DELETE FROM main WHERE key ='5';
C2: INSERT INTO main (key,second_key,value_store) VALUES ('5', '5', '10');
C2: COMMIT;
C3: SET TRANSACTION READ WRITE WAIT ISOLATION LEVEL SNAPSHOT TABLE STABILITY;
C3: Select value_store from main where key = '5'; -> Result 10
C1: Select * from main where second_key <= '5'; -> Result
C1: COMMIT;
C3: select value_store from second_table where key = '1'; -> Result
C3: COMMIT;
The history we see above is not serializable since there is no permutation of transactions that will allow the above results to be seen. Reading documentation from ibphoenix, Snapshot Table Stability (or Consistency) is serializable. Is this document accurate?