2 Replies Latest reply: May 19, 2014 1:35 PM by userBDBDMS-Oracle RSS

    Queue consumer stops with 100% cpu usage

    cf5948cd-fa3d-4376-949f-6f05f3ac9b63

      I'm trying to use Berkeley DB queue with transactions. When I tested what happens when transactions with DB_APPEND are aborted I found that while it works and DB_CONSUME correctly skips over rolled back records, unfortunately extents that have those records are never deleted, which causes database to always grow. Next I tried DB_CONSUME with database opened using DB_INORDER flag and it seems there's a serious regression in Berkeley DB that causes it to loop indefinitely with 100% cpu usage when it encounters a rolled back record. I tested various versions and found that this bug doesn't happen with 5.1.29, but it is reproducible with 5.2.42, so this regression might have been introduced in 5.2. I have also tested 5.3 and 6.0, and both have this behavior. There may be something wrong with the way queue records are rolled back, one indication of that would be that in 5.1.29 doesn't have neither of the two problems I found with DB_QUEUE: extents are deleted after being consumed, and there are no issues when consuming with DB_INORDER either.

       

      You can find Python code to reproduce this issue here:

       

      https://gist.github.com/snaury/027a3c546f5b0a62a440

       

      Sorry for using Python and not e.g. C++, but it's a lot shorter that way.