Coding best practice : Lucene search query : resultSet.close() : part2

To continue on the same topic (see Part1 of this post):

I have open a JIRA issue, because I think we have identified a code defect in Alfresco code itself…Click here for more details.

Basically the “symptom” is that we can see that our lucene index seems to grow continuously in production.

When running the command:
find . -type d | wc -l
in:
<alfresco>/alf_data/lucene-indexes/workspace/SpacesStore/

It returns more than 21000 directories !

As per our discussion with Alfresco service guy, we should not have more than 100 directories in “<alfresco>/alf_data/lucene-indexes/workspace/SpacesStore/”.

This is a know issue in v2.1.1 when Lucene ResultSet are not closed properly.

We have checked the code of alfresco-enterprise-sdk-2.1.1 and it seems that ResultSet is not closed properly in:
java.org.alfresco.web/bean.wizard.InviteUsersWizard.java

Also, As per our discussion with Alfresco service:
– in release 2.1.6 and higher, the issue is fixed (i.e not closing resultset does not leads to a growing lucene index).

– if we want to “merge” the current lucene indexes to reduce the number of files, we must upgrade to release 2.2.3 (E ?). When the server will start, it will be able to automatically merge the lucene indexes.

Please note that this has to be confirmed by support, so check JIRA issue ALFCOM-3683 status for latest update on this.

Advertisements

2 Responses to Coding best practice : Lucene search query : resultSet.close() : part2

  1. Enguerrand SPINDLER says:

    Another JIRA already exist on this : https://issues.alfresco.com/jira/browse/ETWOTWO-1386

  2. Dirk says:

    Unfortunally this in not all. Even the alfresco TaggingServiceImpl doesn’t care about closing resultsets: https://issues.alfresco.com/jira/browse/ALFCOM-3812 . This means, working with tagged content produces continually new index folders!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: