MySQL Forums
Forum List  »  Memory Storage Engine

MEMORY table rows randomly disappear - help!
Posted by: jkoerber
Date: May 16, 2010 09:37AM

I am using a MEMORY table to speed the user authentication process in our Web application. When a user signs-in, a record is INSERTED into the table with a timestamp 30 minutes longer than the current system timestamp. On every click in the application the record is read to see if the user has exceeded the 30-minute timeout interval, if so they are kicked out, if not, the record is UPDATED with a new 30-minute timeout value.

I have been seeing many instances where a user continually signs-in to our application (sometimes 5 times in 50 seconds). I was finally able to reproduce the issue myself on my development machine (so I know it is happening in production as well as development). After signing in and then clicking to a new page in our application I was immediately kicked out for timeout. I queried the MEMORY table in a terminal window while performing the same actions in my Web browser and was amazed to see my sign-in row disappear between one query or update to the next!

I looked in the binary logs and did indeed see the value being INSERTED, so am very confused as to how these rows are randomly disappearing from the MEMORY table? Also, there are absolutely no DELETE statements used on that table, so it is something else causing the records to disappear from the table. Nothing appeared in the binary logs after the record disappeared to help me debug this issue.

The issue seems to happen at random, as sometimes users can stay logged in for hours without a problem while some users will get repeatedly kicked out after only a few seconds of work due to the fact that their MEMORY table authentication record is gone and cannot be updated.

Has anyone else seen this kind of activity before? I am at a loss as to what to do other than stop using MEMORY tables?

Mac OS X Server 10.6.x -- MySQL Server 5.1.40

Options: ReplyQuote


Subject
Views
Written By
Posted
MEMORY table rows randomly disappear - help!
7846
May 16, 2010 09:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.