on 05-05-2017 6:45 PM
Hi
After finding contention on tables and lots of deadlocks in our preprod ASE15.7 SP62 (Solaris10) database, I converted 10 tables from Allpages to Datarows.
Following this change the application process that merges user data to the same user application ID is failing. The application log files do not show much about what is failing. I only found a few errors about the stored procedure (SP) that merges the appID but there is no direct correlation between this SP failure and the visible errors (the timestamp and the number of errors do not match)
I digged into this SP (which calls many other SPs to merge the user ID and other related ID/data) and only found a "select with holdlock" directly related to locking.
1) What could be the rationale behind this problem?
2) The application team is thinking about a potential transaction failing then rollbacking. How could I monitor a failing transaction or rollbacking transaction in ASE (Mda tables?)?
3) After changing the lock scheme of these tables, I see less deadlocks. I have the feeling that the locking problems just moved to other tables and made somehow the application problems (previously reflected by the deadlocks) to go back up to the surface.
Any ideas how to approach this problem? It's in preprod so I can make changes.
Vincent
I agree with Mark that we could use more details about the nature of the data inconsistency / application failure.
As you are switching to datarows, one thing that does come to mind as being possibly related is that the datarows lock scheme has an interesting property:
At the default isolation level (read committed), uncommitted inserts into datarows tables do not block readers.
[infocenter has been up and down recently. The document linked to here is the 15.7 Performance and Tuning Guide: Locking and Concurrency Control, Chapter 1, section "Skipping uncommitted inserts during selects".]
This sometimes takes developers who are used to working with allpage lock scheme tables, where inserts do block, by surprise as it makes some queries more susceptible to read skew.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the problem is due to what Bret was explaning about uncommitted inserts into datarows tables not blocking readers.
The app problem is detected when the same values are inserted into one table. This table has an unique clustered index on 3 columns: 2 IDs and a timestamp. The app developers told me that multiple processes can add entries in this table if they don't find the expected values. If multiple processes can interact with the tables within 1 second or 2, you end up with sort of duplicas with the same 2 IDs but a different timestamp....
I've converted this table from Datarows to Datapages (used to be Allpages). Since then I have not observed any duplicas.
My explanation is probably very unclear but to summarize the application logic should be reviewed to guarantee that multiple processes don't perform the same operation or more inteligently if we decide to use Datarows locking.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.