From 59f3c790048c9036adb81d56329a66fc3ffb255a Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 13 May 2019 12:54:52 +0530 Subject: protocol/client: don't reopen fds on which POSIX locks are held after a reconnect Bricks cleanup any granted locks after a client disconnects and currently these locks are not healed after a reconnect. This means post reconnect a competing process could be granted a lock even though the first process which was granted locks has not unlocked. By not re-opening fds, subsequent operations on such fds will fail forcing the application to close the current fd and reopen a new one. This way we prevent any silent corruption. A new option "client.strict-locks" is introduced to control this behaviour. This option is set to "off" by default. Change-Id: Ieed545efea466cb5e8f5a36199aa26380c301b9e Signed-off-by: Raghavendra G updates: bz#1694920 --- xlators/mgmt/glusterd/src/glusterd-volume-set.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-set.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index e4427069263..f7bfaa2ba3e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1514,6 +1514,19 @@ struct volopt_map_entry glusterd_volopt_map[] = { .op_version = GD_OP_VERSION_3_10_2, .value = "9", .flags = VOLOPT_FLAG_CLIENT_OPT}, + {.key = "client.strict-locks", + .voltype = "protocol/client", + .option = "strict-locks", + .value = "off", + .op_version = GD_OP_VERSION_8_0, + .validate_fn = validate_boolean, + .type = GLOBAL_DOC, + .description = "When set, doesn't reopen saved fds after reconnect " + "if POSIX locks are held on them. Hence subsequent " + "operations on these fds will fail. This is " + "necessary for stricter lock complaince as bricks " + "cleanup any granted locks when a client " + "disconnects."}, /* Although the following option is named ta-remote-port but it will be * added as remote-port in client volfile for ta-bricks only. -- cgit