History | Log In     View a printable version of the current page.  
HQ 4.0 EE Release is Now Available | HQ 3.2.5-EE Maintenance Release is Now Available
Issue Details (XML | Word | Printable)

Key: HHQ-1158
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Scott Feldstein
Reporter: Scott Feldstein
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hyperic HQ

MySQL custom sequences are not working correctly

Created: 24/Oct/07 02:44 PM   Updated: 09/Nov/07 10:14 AM
Component/s: Server
Affects Version/s: 3.2.0
Fix Version/s: 3.2.0

Environment: HQ MySQL DB Backend
Issue Links:
Depends
 

Verify By: Nipuna Bhayani
HQ Fix Version: 3.2
3.0 Category: Scalability & Performance
Last comment: 54 weeks ago
Resolution Date: 26/Oct/07 04:06 PM


 Description  « Hide
Our custom written sequences for mysql have issues around transactions which are rolled back.

Right now the implementation is to take a batch of 1000 sequences from the HQ_SEQUENCE table (innodb engine) and populate the HQ_MEM_SEQUENCE table (memory engine) to avoid the nextseqval() call hanging (and timing out) when it is in a transaction.

When it is time for the batch update to occur if the outer transaction is rolled back the HQ_SEQUENCE table will not reflect the last sequence number correctly in HQ_MEM_SEQUENCE, since innodb engine is transactional and the HQ_SEQUENCE table will be rolled back.

Right now I see two ways of solving this:

1) everytime nextseqval() is called the SEQUENCE tables are checked to make sure that the seq_val is correct based on max(seq_val) from HQ_MEM_SEQUENCE. The problem here is that it is very expensive to do and HQ is much slower during startup and other areas of the app.

2) only execute the checking from # 1 when count(seq_val) == 1 in HQ_MEM_SEQUENCE. This way is a lot faster, but has another issue. If a rollback occurs right before the server is shutdown then we are back to square one. The solution is then to increment the HQ_SEQUENCE table by the <batchsize> everytime HQ is started up. To do this it will take many more sequences, so HQ_SEQUENCE should be changed to an UNSIGNED INT or even UNSIGNED LONG (although I think that is an over-kill).

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Scott Feldstein - 26/Oct/07 04:06 PM
resolved with option #2, it performs much better.

Nipuna Bhayani - 09/Nov/07 10:14 AM
Works fine in release 3.2.0-EE build 527

Stop HQ-Server over night
and everything is fine when started next day in the morning