Revive the Solr plugin using elasticsearch

Bug #680710 reported by Mahmoud Abdalla on 2010-11-23
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
Wishlist
Aaron Wells

Bug Description

- exact version of Mahara : 1.2.3
- operating system : Linux
- database : MySQL

My mah_artifact table contains over 91000 records, i'm on mysql db, and the server has 2GB ram. i tried increasing the mem_limit_max to 2048M in php.ini and still am getting the following problems. I'm also expecting this table to increase to over a million records in the next couple of months.

This repeats everyday at 4:00 and 4:30 AM.

Any help would be appreciated.

Solr Stuff...
-------------
[21-Nov-2010 04:00:22] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes) in /var/www/mahara/lib/dml.php(46) : runtime-created function on line 1
[21-Nov-2010 04:01:22] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes) in /var/www/mahara/lib/dml.php(46) : runtime-created function on line 1
[21-Nov-2010 04:02:21] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes) in /var/www/mahara/lib/dml.php(46) : runtime-created function on line 1
[21-Nov-2010 04:03:20] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes) in /var/www/mahara/lib/dml.php(46) : runtime-created function on line 1
[21-Nov-2010 04:04:20] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes) in /var/www/mahara/lib/dml.php(46) : runtime-created function on line 1
[21-Nov-2010 04:05:01] [DBG] a3 (lib/cron.php:70) ---------- cron running Sun, 21 Nov 2010 04:05:01 +0200 ----------
[21-Nov-2010 04:05:01] [DBG] a3 (lib/cron.php:90) Running PluginInteractionInvite::interaction_invite_send
[21-Nov-2010 04:05:01] [DBG] a3 (lib/cron.php:149) Running core cron rebuild_artefact_parent_cache_dirty
[21-Nov-2010 04:05:01] [WAR] a3 (lib/cron.php:167) core cronjob "rebuild_artefact_parent_cache_complete" didn't get run because the nextrun time (2010-11-21 04:00:00) was too old (less than 1290304801)
[21-Nov-2010 04:05:01] Call stack (most recent first):
[21-Nov-2010 04:05:01] * log_message("core cronjob "rebuild_artefact_parent_cache_comple...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:05:01] * log_warn("core cronjob "rebuild_artefact_parent_cache_comple...") at /var/www/mahara/lib/cron.php:167
[21-Nov-2010 04:05:01]
[21-Nov-2010 04:05:01] [WAR] a3 (lib/cron.php:167) core cronjob "activity_process_queue" didn't get run because the nextrun time (2010-11-21 04:00:00) was too old (less than 1290304801)
[21-Nov-2010 04:05:01] Call stack (most recent first):
[21-Nov-2010 04:05:01] * log_message("core cronjob "activity_process_queue" didn't get r...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:05:01] * log_warn("core cronjob "activity_process_queue" didn't get r...") at /var/www/mahara/lib/cron.php:167
[21-Nov-2010 04:05:01]
[21-Nov-2010 04:05:01] [WAR] a3 (lib/cron.php:167) core cronjob "import_process_queue" didn't get run because the nextrun time (2010-11-21 04:00:00) was too old (less than 1290304801)
[21-Nov-2010 04:05:01] Call stack (most recent first):
[21-Nov-2010 04:05:01] * log_message("core cronjob "import_process_queue" didn't get run...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:05:01] * log_warn("core cronjob "import_process_queue" didn't get run...") at /var/www/mahara/lib/cron.php:167
[21-Nov-2010 04:05:01]
[21-Nov-2010 04:05:01] [WAR] a3 (lib/cron.php:167) core cronjob "import_cleanup_old_imports" didn't get run because the nextrun time (2010-11-21 04:00:00) was too old (less than 1290304801)
[21-Nov-2010 04:05:01] Call stack (most recent first):
[21-Nov-2010 04:05:01] * log_message("core cronjob "import_cleanup_old_imports" didn't g...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:05:01] * log_warn("core cronjob "import_cleanup_old_imports" didn't g...") at /var/www/mahara/lib/cron.php:167
[21-Nov-2010 04:05:01]

Solr again at 4:30am...
-------------
[21-Nov-2010 04:29:01] [DBG] 2a (lib/cron.php:70) ---------- cron running Sun, 21 Nov 2010 04:29:01 +0200 ----------
[21-Nov-2010 04:29:01] [DBG] 2a (lib/cron.php:90) Running PluginSearchSolr::rebuild_all
[21-Nov-2010 04:29:01] [DBG] 2a (search/solr/lib.php:427) Starting rebuild_users()
[21-Nov-2010 04:29:24] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7680 bytes) in /var/www/mahara/lib/dml.php(46) : runtime-created function on line 1
[21-Nov-2010 04:30:01] [DBG] 92 (lib/cron.php:70) ---------- cron running Sun, 21 Nov 2010 04:30:01 +0200 ----------
[21-Nov-2010 04:30:01] [WAR] 92 (lib/cron.php:126) cronjob "solr.rebuild_all" didn't get run because the nextrun time was too old
[21-Nov-2010 04:30:01] Call stack (most recent first):
[21-Nov-2010 04:30:01] * log_message("cronjob "solr.rebuild_all" didn't get run because ...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:30:01] * log_warn("cronjob "solr.rebuild_all" didn't get run because ...") at /var/www/mahara/lib/cron.php:126
[21-Nov-2010 04:30:01]
[21-Nov-2010 04:30:03] [DBG] 92 (lib/cron.php:90) Running PluginInteractionForum::interaction_forum_new_post
[21-Nov-2010 04:30:03] [WAR] 92 (lib/cron.php:126) cronjob "invite.interaction_invite_send" didn't get run because the nextrun time was too old
[21-Nov-2010 04:30:03] Call stack (most recent first):
[21-Nov-2010 04:30:03] * log_message("cronjob "invite.interaction_invite_send" didn't ge...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:30:03] * log_warn("cronjob "invite.interaction_invite_send" didn't ge...") at /var/www/mahara/lib/cron.php:126
[21-Nov-2010 04:30:03]
[21-Nov-2010 04:30:03] [WAR] 92 (lib/cron.php:167) core cronjob "rebuild_artefact_parent_cache_dirty" didn't get run because the nextrun time (2010-11-21 04:25:00) was too old (less than 1290306301)
[21-Nov-2010 04:30:03] Call stack (most recent first):
[21-Nov-2010 04:30:03] * log_message("core cronjob "rebuild_artefact_parent_cache_dirty"...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:30:03] * log_warn("core cronjob "rebuild_artefact_parent_cache_dirty"...") at /var/www/mahara/lib/cron.php:167
[21-Nov-2010 04:30:03]
[21-Nov-2010 04:30:03] [WAR] 92 (lib/cron.php:167) core cronjob "activity_process_queue" didn't get run because the nextrun time (2010-11-21 04:25:00) was too old (less than 1290306301)
[21-Nov-2010 04:30:03] Call stack (most recent first):
[21-Nov-2010 04:30:03] * log_message("core cronjob "activity_process_queue" didn't get r...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:30:03] * log_warn("core cronjob "activity_process_queue" didn't get r...") at /var/www/mahara/lib/cron.php:167
[21-Nov-2010 04:30:03]
[21-Nov-2010 04:30:03] [WAR] 92 (lib/cron.php:167) core cronjob "import_process_queue" didn't get run because the nextrun time (2010-11-21 04:25:00) was too old (less than 1290306301)
[21-Nov-2010 04:30:03] Call stack (most recent first):
[21-Nov-2010 04:30:03] * log_message("core cronjob "import_process_queue" didn't get run...", 8, true, true) at /var/www/mahara/lib/errors.php:111
[21-Nov-2010 04:30:03] * log_warn("core cronjob "import_process_queue" didn't get run...") at /var/www/mahara/lib/cron.php:167
[21-Nov-2010 04:30:03]

See also this discussion at mahara.org: http://mahara.org/interaction/forum/topic.php?id=2467#post11214
It may be the same problem.

The solr plugin shouldn't try to reindex unless it's enabled; we should double check that this is working.

Changed in mahara:
status: New → Triaged
importance: Undecided → High
Mahmoud Abdalla (mmabdalla) wrote :

Yes, but it IS enabled. we have enabled it because data change every day, and we'd like to see the search become updated. Has solr been used on large data intense mahara installations before? i mean in a heavy deployment production level installation?

Hi Mahmoud,

Solr search used to work back in about Mahara 1.0 days, with Solr 1.2.

I haven't tried it since way back, but I was told it no longer worked so I removed the solr option from the site options page for 1.3. Looking at it now, it relies on snoopy/Snoopy.class.php which was removed some time ago (not sure why exactly), but I guess it may still work if you have installed snoopy independently of Mahara.

But even if it's still possible to get it to work, we will probably leave it out of the admin options until someone rewrites the plugin to remove dependency on snoopy and bring it up to date with the latest version of solr. We also need to check through everything that's been added to Mahara since snoopy got removed to make sure solr is still indexing the right fields.

But if you have managed to get it working, congratulations! If not, and you still need full text indexing, you could try the sphinx plugin by Antti Koskinen (just do a search on mahara.org).

R.

Mahmoud Abdalla (mmabdalla) wrote :

OMG!

Are you telling me that since Mahara 1.2, the platform is being shipped out without a search function?!
I am getting more and more disappointed with Mahara everyday! The main reason we adopted the platform was that it advertised having Social Networking Features!!! which later on, we discovered that it is not even at its basic levels! we had to write a plugin to enable users to invite their friends. There ARE NO Social Networking features in mahara whatsoever! If there is, then point it out even on the Wiki's...

But to learn today that Solr was out since Mahara 1.0! This is shocking news to me really!

Regards,

-MA

Patches welcome :)

Changed in mahara:
importance: High → Wishlist
summary: - Solr Problems
+ Revive the Solr plugin
François Marier (fmarier) wrote :

We should replace solr with http://www.elasticsearch.org/

summary: - Revive the Solr plugin
+ Revive the Solr plugin using elasticsearch
tags: removed: cron exhausted index indexing memory php.ini rebuild solr
tags: added: solr
tags: added: elasticsearch
Aaron Wells (u-aaronw) wrote :

We've got a new elasticsearch plugin!

https://reviews.mahara.org/2389
https://reviews.mahara.org/2390

We should really update the internalsearch plugin so that it can do the same stuff. Even if it can't do it as efficiently.

Changed in mahara:
status: Triaged → In Progress
milestone: none → 1.8.0rc1
assignee: nobody → Aaron Wells (u-aaronw)
Aaron Wells (u-aaronw) wrote :

Our implementation of the elasticsearch plugin is actually only providing search capabilities for the new "universal search" field in the title bar. For everything else, it's delegating responsibility back to the classic internal search plugin.

But it could search everything, probably! So I've spun off a separate bug for, at least, the "Search my portfolio" sideblock: https://bugs.launchpad.net/mahara/+bug/1209074

Aaron Wells (u-aaronw) on 2013-08-29
Changed in mahara:
status: In Progress → Fix Committed
tags: added: nominatedfeature
Aaron Wells (u-aaronw) on 2013-09-30
Changed in mahara:
milestone: 1.8rc1 → 1.8.0
Aaron Wells (u-aaronw) on 2013-10-24
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers