Bug 1654187

Summary: [geo-rep]: RFE - Make slave volume read-only while setting up geo-rep (by default)
Product: [Community] GlusterFS Reporter: Harpreet Kaur Lalwani <hlalwani>
Component: geo-replicationAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: mainlineCC: avishwan, bugs, csaba, khiremat, rallan, rhinduja, rhs-bugs, sankarshan, storage-qa-internal
Target Milestone: ---Keywords: EasyFix, FutureFeature, RFE
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-6.0 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1643370 Environment:
Last Closed: 2019-03-25 16:32:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1643370    
Bug Blocks:    

Comment 1 Worker Ant 2018-11-28 08:54:52 UTC
REVIEW: https://review.gluster.org/21739 (geo-rep: Make slave volume read-only (by default)) posted (#1) for review on master by Harpreet Kaur Lalwani

Comment 2 Kotresh HR 2018-11-28 09:00:18 UTC
Description of problem:
=======================
As of now, if we want to make a volume as read-only, we need to specify the volume option and enable it using:

gluster volume set <volume_name> features.read-only on

In geo-rep, the main idea is to write to the master and that is synced to the slave. Since writes should not happen from the slave, it is good to make the slave as read-only by default to avoid mishaps.

In the event of a failover/failback scenario where the slave is made the master and writes need to happen from the slave, this read-only option should simply be disabled (along with enabling the other options which enable the slave volume to sync to the original master)


This can be easily done during create command.

Just have to add the below command in hookscript

gluster vol set <slave_vol> features.read-only on 

For root geo-rep:

$SRC//extras/hook-scripts/S56glusterd-geo-rep-create-post.sh for root geo-rep


For non-root geo-rep:

$SRC/geo-replication/src/set_geo_rep_pem_keys.sh

Comment 3 Worker Ant 2018-12-07 09:38:27 UTC
REVIEW: https://review.gluster.org/21739 (geo-rep: Make slave volume read-only (by default)) posted (#8) for review on master by Kotresh HR

Comment 5 Shyamsundar 2019-03-25 16:32:19 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-6.0, please open a new bug report.

glusterfs-6.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://lists.gluster.org/pipermail/announce/2019-March/000120.html
[2] https://www.gluster.org/pipermail/gluster-users/