I needed to change the service classes for some Search API Solr non-Drupal servers with read-only indexes. One of the indexes has over 100 fields. I did not wish to reconfigure the indexes and their facets.

In order to use my new service class extensions, I disabled the servers and indexes, deleted the old servers and created new ones which I then attached the indexes to. This appeared to work just fine. However, in the log file, for each deleted server, there was a notice logged:

"An error occurred while deleting an index' data: '400' Status: Bad Request."

I certainly had not wanted to delete the index records held by search_api_solr much less lose any index data. All of the indexes were set as 'read-only' and yet deleting the server called removeIndex() which sent a Solr query to delete the read-only indexes. (Luckily the query failed or I may have lost an index with over 1 million records.)

The method I used to switch service classes otherwise worked fine, all servers and facets are working normally.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
966 bytes

Ugh, you're right, that's potentially desastrous … Thanks for reporting!
I think the attached patch should help, please try it out (on a development server, of course)!

zenlan’s picture

That works fine, thanks very much!

drunken monkey’s picture

Status: Needs review » Fixed

Great, committed.

Status: Fixed » Closed (fixed)

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