Quantcast
Channel: Innodb memcached plugin in RDS not deleting expired rows - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Innodb memcached plugin in RDS not deleting expired rows

$
0
0

I recently setup an RDS instance in AWS for MySQL 5.6 with the new Memcached InnoDB plugin. Everything works great and my app can store and retrieve cached items from the mapped table. When I store items I provide a timeout, and memcached correctly does not return the item once its TTL has expired. So far so good....

However when I look at the underlying table, it is full of rows which have already expired.

The MySQL documentation (http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-intro.html) indicates that item expiration has no effect when using the "innodb_only" caching policy (although it doesn't explicitly indicate which operation it is referring to). In any case my cache_policies table looks like this:

mysql> select * from innodb_memcache.cache_policies;
+--------------+------------+------------+---------------+--------------+
| policy_name  | get_policy | set_policy | delete_policy | flush_policy |
+--------------+------------+------------+---------------+--------------+
| cache_policy | caching    | caching    | innodb_only   | innodb_only  | 
+--------------+------------+------------+---------------+--------------+
1 row in set (0.01 sec)

So, per the docs the expiration field should be respected.

For reference my containers table looks like this:

mysql> select * from innodb_memcache.containers;
+---------+-----------+-----------+-------------+---------------+-------+------------+--------------------+------------------------+
| name    | db_schema | db_table  | key_columns | value_columns | flags | cas_column | expire_time_column | unique_idx_name_on_key |
+---------+-----------+-----------+-------------+---------------+-------+------------+--------------------+------------------------+
| default | sessions  | userData  | sessionID   | data          | c3    | c4         | c5                 | PRIMARY                | 
+---------+-----------+-----------+-------------+---------------+-------+------------+--------------------+------------------------+
2 rows in set (0.00 sec)

And the data table is:

mysql> desc sessions.userData;
+-----------+---------------------+------+-----+---------+-------+
| Field     | Type                | Null | Key | Default | Extra |
+-----------+---------------------+------+-----+---------+-------+
| sessionID | varchar(128)        | NO   | PRI | NULL    |       | 
| data      | blob                | YES  |     | NULL    |       | 
| c3        | int(11)             | YES  |     | NULL    |       | 
| c4        | bigint(20) unsigned | YES  |     | NULL    |       | 
| c5        | int(11)             | YES  |     | NULL    |       | 
+-----------+---------------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

One more detail, the MySQL docs state that after modifying caching policies you need to re-install the Memcached plugin, but I did not find a way to do this on RDS, so I removed the Memcached option group, rebooted, added the memcached option group again, rebooted again... but there was no apparent change in behavior.

So, to conclude, am I missing some step or configuration here? I would hate to have to create a separate process just to delete the expired rows from the table, since I was expecting the Memcached integration to do this for me.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images