during cron runs, the following function calls updates and deletes against the index.
apachesolr_cron_check_node_table() [apachesolr.index.inc : 251]

no check is done to see if the index is read-only. so, items are deleted from a read-only index

suggesting the following patch to
apachesolr_nodeapi_mass_update()
apachesolr_nodeapi_mass_delete()

Comments

pwolanin’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Active » Needs work

Looks like we have some inconsistency in the code:

apachesolr.admin.inc:154:  if (variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_WRITE) {
apachesolr.module:387:  if (variable_get('apachesolr_read_only', 0)) {
apachesolr_search.module:16:      if (variable_get('apachesolr_read_only', 0)) {

We should fix the code to use the constants everywhere.

craig_’s picture

StatusFileSize
new1.81 KB

good call. original patch updated to use the constants. also includes use of constants (functionality of code unchanged) in the other two locations you mentioned

craig_’s picture

Status: Needs work » Needs review

changing status to needs review

pwolanin’s picture

Looks good - need to test.

craig_’s picture

what can i do to help with this?

i can verify that it fixes the issue in my environment, but not sure how to get this into the overall automated test framework.

pwolanin’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Patch (to be ported)

Well, you are welcome to forward port it to 6.x-2.x and 7.x, and help write some 7.x tests.

I just needed a little time to look at this in context. For the future, please use the -p flag for diff if possible (cvs diff -up, or svn diff -x -p)

It is very straightforward, so committing it to 6.x-1.x.

pwolanin’s picture

StatusFileSize
new3.6 KB

patch applies fuzzily to 6.x-2.x too.

pwolanin’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
pwolanin’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.72 KB

7.x patch - had to do one hunk by hand.

pwolanin’s picture

Status: Needs review » Fixed

#983458 by craig_ : mass update and mass delete ignore setting apachesolr_read_only.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.