[ https://issues.apache.org/jira/browse/SOLR-13271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16780745#comment-16780745 ]
Andrzej Bialecki commented on SOLR-13271: ------------------------------------------ It turns out that actually closing the IndexWriter causes an avalanche of errors in many places, starting with newSearcher, refcounting the directory, reusing the existing SolrCoreState on reopen, etc, etc. Working around this issue would complicate the code a lot. However, there's a boolean flag {{SolrCore.indexEnabled}} that prevents the opening of a new IndexWriter, and it can also be used by DistributedURP to fail-fast ongoing long requests, so this is what the latest patch uses. This flag is turned on by {{CoreContainer}} just after the newly reloaded core has been constructed but before it's registered. The old core's {{indexEnabled}} flag is also turned off (which will cause ongoing requests to fail) and its {{indexWriter.commit()}} is called. IMHO this should be sufficient to address the concerns about the IW still being open and the processing of old ongoing requests. The latest patch also changes the readOnly flag to become a primary collection property. It also reloads the collection both when the flag is turned on and when it's turned off - the latter seems like the easiest way to switch the {{SolrCore.indexEnabled}} flag on all collection cores. > Implement a read-only mode for a collection > ------------------------------------------- > > Key: SOLR-13271 > URL: https://issues.apache.org/jira/browse/SOLR-13271 > Project: Solr > Issue Type: New Feature > Security Level: Public(Default Security Level. Issues are Public) > Affects Versions: 8.x, master (9.0) > Reporter: Andrzej Bialecki > Assignee: Andrzej Bialecki > Priority: Major > Fix For: 8.x, master (9.0) > > Attachments: SOLR-13271.patch > > > Spin-off from SOLR-11127. In some scenarios it's useful to be able to block > any index updates to a collection, while still being able to search its > contents. > Currently the scope of this issue is SolrCloud, ie. standalone Solr will not > be supported. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org