elgg user sessions table corrupted

I have got in to an error where i am not able to repair the elgg user session table.. When i first tried to repair the table i got an error stating 

--myisam_sort_buffer_size too small

 number of rows changed from 0 to 11307630

after this error i tried using this command myisamchk -r  elgg_users_sessions --sort_buffer_size=2G

this will fail after getting hanged by going in to out of memory error eventually the processor gets killed .. now if i use the same command again i get an error stating "elgg_users_sessions is not fixed because of errors Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag"

the only command that now works is this myisamchk -r -f elgg_users_sessions --sort_buffer_size=20G  but if i use this system goes hanging at 3665000

I have been trying this entire night but i am not able to recover as the system keep killing the myisamchk for out of memory stuff .. can anyone help me to fix this in some other way .. 

 

  • I even tried emtying the elgg users sessions .. after which i try to again run the repair DB in WHM i get an error stating "Can't create new tempfile" again the user session goes to non usable .. 

    I want to know is it normal or there is some other serious damage has been caused to my DB ?? 

    bcz when running repair DB i get everything ok except elgg_users_sessions which some how the other giving error ..

  • even my PHP sessions have been given the default value as per the below link ..

    http://php.net/manual/en/session.configuration.php#ini.session.auto-start

  • Some how i got it fixed .. but i have a simple doubt .. why do i have so many system log Tables in my DB .. 

    elgg_DB.elgg_system_log                   OK
    elgg_DB.elgg_system_log_1525545246        OK
    elgg_DB.elgg_system_log_1526150043        OK
    elgg_DB.elgg_system_log_1526754854        OK
    elgg_DB.elgg_system_log_1527359662        OK
    elgg_DB.elgg_system_log_1527964202        OK

    is this normal that system log creates multiple table in the DB ..

  • why do i have so many system log Tables in my DB .. 

    Use Log rotate and Garbage collector plugins (bundled both)

  • @meril Could you tell how you got it fixed in the end? It might help to know in case others also got into trouble with repairing a corrupt table.

    Regarding the log tables: log table, logrotate and garbagecollector are in part different things. First, the garbagecollector plugin (the work it does when the plugin is enabled and the cronjob corresponding to the interval selected in the garbagecollector plugin settings is set up) does some cleanup/optimization on the tables of the Elgg database. That's not related to log stuff as far as I know. The log table is used by the log functions of Elgg core (not provided by a plugin in Elgg 2.x but I think in Elgg 3 it will be and can be disabled) that hook into some event hooks triggered for example on create/delete events etc. So, the log table in use is the table without the timestamp in the table name (in your case the table elgg_DB.elgg_system_log). The tables with the timestamps are created by the logrotate plugin at the interval set up in its plugin settings (as long as there's a cronjob set up on the server for this interval). Basically, the logrotate plugin archives the log entries to prevent the log table getting too large. On recent versions of Elgg the logrotate plugin also has a setting to delete the archived log tables after a certain time (so you might want to check what's set for the delete after intervall currently in the logrotate plugin settings). If you don't make use of the Elgg log table entries anyway, you could select a short period for deleting the old log table archives. If you don't bother about the Elgg log table stuff at all anyway (like me) you could also use my No Logging plugin (https://elgg.org/plugins/1441338) that unregisters the Elgg core log hooks and therefore keeping the log table empty (at least as long as no plugin adds stuff on its own by other means). If using the No Logging plugin you would still have to keep the log table (otherwise you get an error). But you could think about disabling the logrotate plugin after a will once the log table has been archived. As I mentioned, I think Elgg 3 will make the No Logging plugin obsolete if you can turn off logging by core functionality (or a core plugin).

  • @iionly: S .. How i fixed it after careful reading of the previous discussions thread of elgg i came to an understanding that we can delete all the entries in the elgg_users_sessions.. So i first took the backup of the entire DB before i can delete the entries in the table.. I used WHM --> Php admin tool to Empty the elgg_users_sessions.. Then i tried to repair the DB using the following command..

    command --> myisamchk -r -f -t /home/temp elgg_users_sessions --sort_buffer_size=20G 

     I used the /home/temp to make the mysql to use the sorting in /home/temp file as the fixing of index is using a large space make the myisamchk not able to create a temp file for elgg_users_sessions .. next thing is make sure you use these commands by navigating to your mysql --> elggDB folder in linux it's located at /var/lib/mysql/(Your elgg DB name)

    then for a checking i ran the DB repair option in WHM which gave me a green signal .. In oder to clear the myisamchk temp files from the hardisk i gave a soft reboot of the server ..

  • @meril

    Before the crash, how large was your sessions table? If it contained millions of rows maybe check the PHP settings for auto session cleanup https://secure.php.net/manual/en/session.configuration.php especially the session.gc* settings

  • @jerome: yep i have done it corrected the session.gc to 100 .. Thank you ..

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.