1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-06 18:48:16 +01:00

7 Commits

Author SHA1 Message Date
Ravishankar N
36b37221af tests: fix yet another afr-lock-heal-basic.t spurious failure (#2438)
* tests: fix yet another afr-lock-heal-basic.t spurious failure

From the logs, it appears as if the lock info was not present in the
statedump when it was generated. Changed the logic to check for the lock
info in successive statedumps within PROCESS_UP_TIMEOUT.

Fixes: #2394
Change-Id: I5b071299d05a8c68b02735dfd8b510b0485dc9ce
Signed-off-by: Ravishankar N <ravishankar@redhat.com>

* remove sleep

Change-Id: I822446222d2fbf824c6eaf42f3c72808356071e3
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2021-05-17 12:44:31 +05:30
Pranith Kumar Karampuri
02074cfe3b cluster/dht: Perform migrate-file with lk-owner (#1581)
* cluster/dht: Perform migrate-file with lk-owner

1) Added GF_ASSERT() calls in client-xlator to find these
issues sooner.
2) Fuse is setting zero-lkowner with len as 8 when the fop
doesn't have any lk-owner. Changed this to have len as 0
just as we have in fops triggered from xlators lower to
fuse.

* syncop: Avoid frame allocation if we can
* cluster/dht: Set lkowner in daemon rebalance code path
* cluster/afr: Set lkowner for ta-selfheal
* cluster/ec: Destroy frame after heal is done
* Don't assert for lk-owner in lk call
* set lkowner for mandatory lock heal tests

fixes: #1529
Change-Id: Ia803db6b00869316893abb1cf435b898eec31228
Signed-off-by: Pranith Kumar K <pranith.karampuri@phonepe.com>
2020-10-29 09:52:20 +05:30
Pranith Kumar K
473bf33508 Fix ./tests/basic/fencing/afr-lock-heal-basic.t failure
In brick-mux tests, all bricks of the volume have same pid.
"generate_brick_statedump" cleans up the older statedumps
with same brick pid. So successive calls to this function
will delete previous brick's statedump as all bricks share
same pid. So grep calls to the statedump were failing leading
to failure of the .t

To fix this, stored the result we need from statedump before calling
next brick's statedump

Fixes: #1234
Change-Id: I824ed4dff79e7242b3e980364836b9af0e87a6ee
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2020-05-11 10:26:56 +05:30
Ravishankar N
a29a97a0d5 tests: fix afr-lock-heal-* failure
When brick-mux is enabled:

i)brick statedumps seem to be listing the same lock information multiple times.
While that is getting fixed, make changes to the .ts to check for unique values.

ii)detecting a brick as online via brick_up_status() seems to be taking
longer time when delaygen is enabled. Hence bump up PROCESS_UP_TIMEOUT to
90 for afr-lock-heal-advanced.t

Updates: #1042
Change-Id: Ife76008f7a99dd1f1fe5791a32577366baaab4b3
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2020-02-21 18:13:57 +05:30
Ravishankar N
3b90883ce7 afr: lock healing changes
Implements lock healing for gluster-block fencing use case.

If mandatory lock is enabled:
- Add domain lock/unlock to afr_lk fop.
- Maintain a list of locks to be healed in afr_private_t.
- Add lock to the list if afr_lk(F_SETLK or F_SETLKW) was sucessful.
- Remove it from the list during afr_lk(F_UNLCK).
- On child_down, mark lock as needing heal on that child. If lock is
lost on quorum no. of bricks, remove it from the list and mark fd bad.
- For fds marked as bad, fail the subsequent fd based fops.
- On parent up, traverse the list and heal the locks IFF the client is
the lk owner and has quorum. (shd does not heal any locks).

updates: #613
Change-Id: I03c46ceaea30f5e6236d5ec13f71d843d827f1bc
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2019-10-16 13:06:29 +05:30
Susant Palai
09e7eca47d locks/fencing: Add a security knob for fencing
There is a low level security issue with fencing since one client
can preempt another client's lock.

This patch does not completely eliminate the issue of a client
misbehaving, but certainly it adds a security layer for default use cases
that does not need fencing.

Change-Id: I55cd15f2ed1ae0f2556e3d27a2ef4bc10fdada1c
updates: #466
Signed-off-by: Susant Palai <spalai@redhat.com>
2019-01-18 17:26:36 +05:30
Susant Palai
deea53b9fe lock: Add fencing support
design reference: https://review.gluster.org/#/c/glusterfs-specs/+/21925/

This patch adds the lock preempt support.

Note: The current model stores lock enforcement information as separate
xattr on disk. There is another effort going in parallel to store this
in stat(x) of the file. This patch is self sufficient to add fencing
support. Based on the availability of the stat(x) support either I will
rebase this patch or we can modify the necessary bits post merging this
patch.

Change-Id: If4a42f3e0afaee1f66cdb0360ad4e0c005b5b017
updates: #466
Signed-off-by: Susant Palai <spalai@redhat.com>
2018-11-30 15:04:17 +05:30