[ 
https://issues.apache.org/jira/browse/JENA-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214011#comment-13214011
 ] 

Paolo Castagna commented on JENA-214:
-------------------------------------

> This needs to "work nice" with the configuration file as that's the way 
> everything should be done.
> To create a permanently read-only datasets, you configure in only read-only 
> services. 

Ack. 

Maybe a sensible thing to do it to allow to set in read-only mode only datasets 
which have been configured to be read-write and reject a request to set in 
read-write mode a dataset which has been configured as read-only.

> Either this feature must know which services are write so as to set some flag 
> as it's one servlet instance per service per dataset or the config needs 
> modifying carefully. 

I am looking at the Jetty's ServletContextHandler and see if there are ways to 
get the list of servlets corresponding to a path (a dataset in out case).
If that is possible, we can check if a 
SPARQL_Update|SPARQL_Upload|SPARQL_REST_RW are there. This way we identify 
datasets which have been configured in read-write mode.
Assuming we can do that, I need to check what happens if I add a different 
servlet to the same path, so that we could substitute an existing one with a 
version which temporary reject write operations.

I think it would be acceptable not to persist these runtime changes to the 
configuration and assume that when Fuseki is restarted everything is back to 
what stated in the configuration.

Let's see what I manage to do (i.e. I've never done this sort of things with 
Jetty)
                
> Allow to set Fuseki (or a single dataset) in read-only mode (and eventually, 
> back into read-write mode)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: JENA-214
>                 URL: https://issues.apache.org/jira/browse/JENA-214
>             Project: Apache Jena
>          Issue Type: New Feature
>          Components: Fuseki
>            Reporter: Paolo Castagna
>            Priority: Minor
>         Attachments: ActionReadOnly.java
>
>
> A very useful MgtCmdServlet with commands such as: "backup", "shutdown", etc. 
> is now available in Fuseki.
> This is proposing a new command to set the server (or a single dataset) in 
> read-only mode and back into read-write mode.
> A use case for this would be to perform a replication via rsync, in order to 
> replicate TDB indexes from server A to server B both servers needs to be set 
> to read-only mode first, the replication can start, when it finishes both 
> servers can be configured back to read-write mode.
> Another use case would be, enabling a backup with an external tool or any 
> other operation which needs to have exclusive access to TDB indexes and/or 
> ensure all data has been flushed to disk and there are no in-flight write 
> transactions.
> See also a relevant message from jena-dev mailing list:
>  - 
> http://mail-archives.apache.org/mod_mbox/incubator-jena-dev/201201.mbox/%3C4F1F1C9B.9050309%40apache.org%3E

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to