Bug 1341435

Summary: successful mkdir from "bad" subvolume should be ignored while propagating result to higher layer
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Raghavendra G <rgowdapp>
Component: replicateAssignee: Pranith Kumar K <pkarampu>
Status: CLOSED WONTFIX QA Contact: storage-qa-internal <storage-qa-internal>
Severity: unspecified Docs Contact:
Priority: medium    
Version: rhgs-3.1CC: bugs, ravishankar, rgowdapp, rhs-bugs
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1341429 Environment:
Last Closed: 2018-04-16 18:19:04 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: 1341429    
Bug Blocks:    

Description Raghavendra G 2016-06-01 04:35:32 UTC
+++ This bug was initially created as a clone of Bug #1341429 +++

Description of problem:

For Preop checks like [1], dentry operations like mkdir etc would rely on xattrs on parent (like dht layout). However, a "bad" subvolume of afr cannot make correct decision during preop check as the xattrs are not guaranteed to be correct. Imagine the following scenario:
a. mkdir succeeds on non-readable subvolume
b. fails on readable subvolume (may be because of layout xattrs didn't match).

afr here would report mkdir as success to parent xlators (here dht). However, since non-readable subvolume is not guaranteed to have correct xattrs, mkdir shouldn't have succeeded. Worse still, if mkdir on readable subvolume had failed because preop check failed (client in memory layout xattrs and layout xattrs persisted on disk didn't match), we would be ignoring a genuine failure and instead transforming it as a success.

dht is planning to introduce pre-operation checks on all dentry and lock (posix-locks, inodelk, entrylk) operations. So, without some sort of support from lower layers on xattr consistency (as these preops primarily rely on xattrs) it is impossible for a correct implementation.

[1] http://review.gluster.org/13885


Version-Release number of selected component (if applicable):
mainline, 3.7.11, 3.8

How reproducible:
bug was filed as a result of design discussion.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Ravishankar N 2017-08-29 11:45:20 UTC
Hi Du, Is this pre-operation check on all dentry and lock operations as mentioned in the bug description introduced in DHT yet?

Comment 3 Raghavendra G 2017-09-14 12:12:37 UTC
(In reply to Ravishankar N from comment #2)
> Hi Du, Is this pre-operation check on all dentry and lock operations as
> mentioned in the bug description introduced in DHT yet?

Its done in mkdir codepath [1].

[1] http://review.gluster.org/13885