sds transactions
Posted in 2016
Topics: High Availability & Replication, Transactions, Locking & Isolation
I don't understand sds secondary isolation in transactions
I'm making some test and I'm a bit confused, perhaps something is not well set:
--Primary
create table kk(k char(1));begin work;
insert into kk values (2);
--Secondary
select * from kk --> 2
---
--dirty read?; I keep test without closing transaction:
---
--Primary
delete from kk where 1 = 1;
--Secondary
select * from kk --> 2
---
--? didnt get the delete transaction
---
--Primary
insert into kk values (1);
--Secondary
select * from kk --> 1;
--Primary
insert into kk values (3);
insert into kk values (4);
---Secondary
select * from kk --> 1;
----
--?????
----
If you commit transactions in sds secondary you see all ok, it just when
transactions are created in primary node and secondary queries the tables
affected by the transaction. SDS read only in my tests...
Original post:
I don't understand sds secondary isolation in transactions
I'm making some test and I'm a bit confused, perhaps something is not well set:
<steps removed>
If you commit transactions in sds secondary you see all ok, it just when
transactions are created in primary node and secondary queries the tables
affected by the transaction. SDS read only in my tests...
Response:
I followed your steps and got the same results on 12.10.xC7. So first off, if
you use onstat -g ses on the SDS instance for the session doing the queries,
you can see that, yes the isolation level being used is dirty read. However,
the oddities you are picking up, appears to be whether or not the log record
for the DML action (so your inserts/deletes) is getting applied on the SDS
server or not yet. When doing the inserts and deletes, the log records are in
the logical log buffer, and may not immediately be flushed to disk (which is 1
of the mechanisms used to alert the SDS server it has log records it needs to
apply so that the pages on both instances appears the same). So there can be a
delay at this time where the change has happened on the primary, but the log
record isn't yet applied on the SDS server. That would appear to be what you
are seeing. If you throw in a 2nd window on your primary and did something
that forced log buffer flushes (like an easy thing to do would be to force
checkpoints after each insert/delete via onmode -c), then I believe you would
see the results you would be expecting in your selects, as if they were the
default of dirty read isolation level. If I remember correctly off the top of
my head, I think to be able to use any other isolation level then dirty read
on the SDS server, it needs to be updatable.
Jacques Renaut
IBM Informix Advanced Support
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g