Searchable index gets locked on manual update (LockObtainFailedException)

前端 未结 1 1107
迷失自我
迷失自我 2021-01-21 09:43

We have a Grails project that runs behind a load balancer. There are three instances of the Grails application running on the server (using separate Tomcat instances). Each in

相关标签:
1条回答
  • 2021-01-21 10:32

    You can try increasing the 'compass.transaction.lockTimeout' setting. The default is 10 (seconds).

    Another option is to disable concurrency in Compass and make it synchronous. This is controlled with the 'compass.transaction.processor.read_committed.concurrentOperations': 'false' setting. You might also have to set 'compass.transaction.processor' to 'read_committed'

    These are the compass settings we are currently using:

    compassSettings = [
    'compass.engine.optimizer.schedule.period': '300',
    'compass.engine.mergeFactor':'1000',
    'compass.engine.maxBufferedDocs':'1000',
    'compass.engine.ramBufferSize': '128',
    'compass.engine.useCompoundFile': 'false',
    'compass.transaction.processor': 'read_committed',
    'compass.transaction.processor.read_committed.concurrentOperations': 'false',
    'compass.transaction.lockTimeout': '30',
    'compass.transaction.lockPollInterval': '500',
    'compass.transaction.readCommitted.translog.connection': 'ram://'
    ]
    

    This has concurrency switched off. You can make it asynchronous by changing the 'compass.transaction.processor.read_committed.concurrentOperations' setting to 'true'. (or removing the entry).

    Compass configuration reference: http://static.compassframework.org/docs/latest/core-configuration.html

    Documentation for the concurrency of read_committed processor: http://www.compass-project.org/docs/latest/reference/html/core-searchengine.html#core-searchengine-transaction-read_committed

    If you want to keep async operations, you can also control the number of threads it uses. Using compass.transaction.processor.read_committed.concurrencyLevel=1 setting would allow asynchronous operations but just use one thread (the default is 5 threads). There are also the compass.transaction.processor.read_committed.backlog and compass.transaction.processor.read_committed.addTimeout settings.

    I hope this helps.

    0 讨论(0)
提交回复
热议问题