[
https://issues.apache.org/jira/browse/SOLR-13271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16777909#comment-16777909
]
Andrzej Bialecki commented on SOLR-13271:
------------------------------------------
This patch implements the read-only functionality as a collection property,
which can be set / unset using MODIFYCOLLECTION command.
Setting the property to true not only blocks the processing of new updates but
also reloads the collection, which guarantees that all in-flight updates (and
background merges) are properly committed and finished.
Updates sent to a read-only collection are rejected in
{{DistributedUpdateProcessor}}. Updates still can be forced by specifying a
{{readOnlyIgnore=true}} request param. Updates are accepted again when the
property is missing or set to false.
One thing I wasn't sure about was whether to use an attribute that is a
first-class citizen in DocCollection, or use an auxiliary property. Current
patch uses {{property.readOnly}}, which guarantees good back-compat but is
somewhat awkward to manipulate:
* set the property:
{code}
/admin/collections?action=MODIFYCOLLECTION&name=collection1&property.readOnly=true
{code}
* unset the property:
{code}
/admin/collections?action=MODIFYCOLLECTION&name=collection1&property.readOnly=
{code}
A more natural API would be to use a primary collection attribute:
{code}
/admin/collections?action=MODIFYCOLLECTION&name=collection1&readOnly=true
{code}
> 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 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: [email protected]
For additional commands, e-mail: [email protected]