steverobbins / Magento-Redismanager

Superuser control for Redis in Magento
137 stars 31 forks source link

Redis databases not flushing from admin #23

Closed vlmironoff closed 5 years ago

vlmironoff commented 8 years ago

Hello Steve, First of all thank you for the great module you created. I have noticed a little weird behavior flushing redis databases. I installed Redis and created 2 databases on the default instance - for cache and for sessions. Redismanager was working perfectly, when i hit flush all it flushed all dbs and since all sessions were gone i was automatically logged out on refresh. Then I decided to fire up a separate instance of redis and move sessions there: RedisManager picked up this change perfectly, however when I click Flush All (or flush individual db) - the module displays success message but the session is still there - neither i'm being logged out nor session gets evicted when i do KEYS * in redis-cli. Please suggest. Thank you!

steverobbins commented 8 years ago

Which flushall button are you using? Can you share your redis configuration from local.xml and/or a screenshot of the Redis Management section in the admin?

vlmironoff commented 8 years ago

I tried using each and every button that has the word FLUSH on it: the one to flush all dbs on all instances of redis (button on the very top), the one flushing all dbs on individual instance, the one flushing individual db. Here is the redis config from local.xml:

        <cache>
          <backend>Mage_Cache_Backend_Redis</backend>
          <backend_options>
            <server>127.0.0.1</server>
            <port>6379</port>
            <persistent></persistent>
            <database>0</database>
            <password></password>
            <force_standalone>0</force_standalone>
            <connect_retries>1</connect_retries>
            <read_timeout>10</read_timeout>
            <automatic_cleaning_factor>0</automatic_cleaning_factor>
            <compress_data>1</compress_data>
            <compress_tags>1</compress_tags>
            <compress_threshold>20480</compress_threshold>
            <compression_lib>gzip</compression_lib>
          </backend_options>
        </cache>
    <session_save>db</session_save>
        <redis_session>
            <host>127.0.0.1</host>
            <port>6380</port>
            <password></password>
            <timeout>2.5</timeout>
            <persistent></persistent>
            <db>0</db>
            <compression_threshold>2048</compression_threshold>
            <compression_lib>gzip</compression_lib>
            <log_level>1</log_level>
            <max_concurrency>6</max_concurrency>
            <break_after_frontend>5</break_after_frontend>
            <break_after_adminhtml>30</break_after_adminhtml>
            <first_lifetime>600</first_lifetime>
            <bot_first_lifetime>60</bot_first_lifetime>
            <bot_lifetime>7200</bot_lifetime>
            <disable_locking>0</disable_locking>
            <min_lifetime>60</min_lifetime> 
            <max_lifetime>86400</max_lifetime>        
    </redis_session>
steverobbins commented 8 years ago

It's working as expected for me when testing. Are you sure Redis is being used for sessions? Have you enabled the Cm_RedisSession module?

Try connecting to the Redis instance

telnet 127.0.0.1 6380

And watch using the monitor command. Do you see the flushall/flushdb command go through when hitting the button in the admin?

vlmironoff commented 8 years ago

Yes Cm_RedisSession module is enabled. When I connect to redis instance (6380) and do FLUSHALL command - it clears all the data and refreshing the admin panel page in magento shortly after that gets me logged out. However when I click Flush All button in the module - it says: 127.0.0.1:6380 flushed, but when I reload the page again - I'm not logged out, meaning the session is not wiped. My Redis server version is 3.0.7 I tried enabling MONITOR mode as you suggested and here is the output:

redis_monitor_log.txt