Closed (fixed)
Project:
Apache Solr Search
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2012 at 14:39 UTC
Updated:
5 Jun 2012 at 13:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
Georgique commentedComment #2
pwolanin commentedyes, looks like a correct fix.
Comment #3
nick_vhI changed the function a little bit more so it becomes more consistent. Would you be so kind to verify? :-)
Comment #4
nick_vhSeems like I included a document->path change here. This is needed because not all the documents that are created by contrib modules provide the path in the document.
This is similar to the patch proposed, just a bit more consistent.
Comment #5
nick_vhComment #6
Georgique commentedSeems like it works nice.
But there is and there was some strange thing: when I queue content for reindexing, I see 29 items queued. After indexing I see 1 doc pending deletion and 28 in index. It is because my status_callback returns false for 1 document. But is it right that it always queued for indexing and then pengind deletion? And from where it is deleted if it is not in index?
Comment #7
nick_vhThis could be correct, it copies all items that are published to the queue. Afterwards, bit by bit, it will validate if it can send the item to solr or not. If the status callback says no it will remove this item from the index (if exists) and it won't index the item again.
So, be careful with the re-index all button :-)
Comment #8
Georgique commentedFine, thanks. So now I see that everything works nice and correct. =)
Comment #9
pwolanin commentedI don't think this is the right approach still.
We have duplicated code and we don't have any robustness in the case the call to delete from the index fails.
Comment #10
pwolanin commentedmarking #1524988: Incorrect side effect in function apachesolr_index_get_entities_to_index() as duplicate, since this patch removes the side effect at least in getting rows to index.
This also adds an attempt at making the removal of an entity from the index more robust. A good test is to shut down solr and then delete or unpublish a node and see if it's eventually removed from the index when you start Solr up again later.
Comment #11
pwolanin commentedThe path fix should go in a different issue/patch if it's not related.
Comment #13
pwolanin commentedHere's a more functional patch (i.e. I actually started testing it).
Comment #14
pwolanin commentedOk, now I'm really confused as to why function apachesolr_get_index_bundles($env_id, $entity_type) depends on the env_id. We are, in general, deleting any excluded bundles from the tracking table, so it won't actually work to track indexing to 2 environemnts at once with different bundles allowed for each. This is a really big problem!
Comment #15
pwolanin commentedComment #16
pwolanin commentedI think the correct answer is that we should not be adding/removing rows based on excluded bundles, since we already handle that in the query to get entities to index.
Comment #18
pwolanin commentedoops - that left a stray line in apachesolr_index_node_solr_reindex().
This fixes some logic errors in that the delete & reindex didn't rebuild the tracking table consistently with just marking all for reindex.
Comment #19
Georgique commented@pwolanin Should I test it as you wrote in #10?
Comment #20
Georgique commentedI shut down Solr (tomcat7), then change one node (it should be removed from index by my status callback), after that start Solr. 1 node is remaining indexing. Pressed "Index" button, and this node moved to "Pending deletions". After 2 minutes it disappeared from search results.
Comment #21
nick_vhBecause this removal from the table could mess our indexing process up I rewrote a small part of the batch code :
It now shows the user the following message :
"100 items successfully processed. 98 documents successfully sent to Solr."
Comment #22
Georgique commented>>> It now shows the user the following message :
When and where I can see it?
Comment #23
nick_vhWhenever you do the "Index remaining items" and it completes successfully.
Comment #24
Georgique commentedBut I applied patch and now only see "Apachesolr cron succesfully executed" message.
Comment #25
Georgique commentedAh, I see. I should see it on batch indexing page. But I have too little documents to see it.
Comment #26
nick_vhAh, It's not the cron :-)
In the admin UI there's a button : Index all queued content. This button starts a batch process that shows you that message. There is no bug in the cron process afaik.
Comment #27
Georgique commentedAh, I thought that difference between those two buttons is only in count of indexing documents.
Tried Index all queued, and see "1 item processed successfully.". But this 1 item is deleted and 40 were indexed. Think it is not right to write so.
Comment #28
nick_vhCommitted to dev. Couldn't reproduce the error Georgique mentions.
Comment #29
nick_vhComment #30
nick_vhComment #32
nick_vhComment #33
nick_vhCommitted to D6