Category prefix is optional when setting Volume options. For example
to set replicate.eager-lock, we can pass `replicate.eager-lock` or
`cluster/replicate.eager-lock`. With this PR, always stored with
category prefix.
Also fixed the issue of loosing template variables when xlator default
options and volinfo.Options are loaded(Fixes: #1397)
Signed-off-by: Aravinda VK <avishwan@redhat.com>
The change is basically in the way we pass xml flag to glfsheal binary.
Previously it was passed with a simple 'xml', now after the change
https://review.gluster.org/#/c/glusterfs/+/21501/
its passed as '--xml' to glfsheal.
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
add Xlator action function to start
daemons if volume starts
add Xlator action function to stop
daemons if volume stops and if daemon
is not managing any other volumes.
update volinfo in ETCD and notify
all nodes about newly generated volfiles
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
In Go, every directory is a distinct package. There is no such thing as
a subpackage. Having `api` is a separate package as a subdirectory in
each plugin ensures that we will not run into cyclic dependency issues.
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Added logging with the log.WithError().
Allocate capacity to slice to reduce the allocation of memory during append.
Added UNDO function in txn steps.
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This change converts the Daemon interface to use an Args
function that returns a []string rather than a string.
It's generally good policy to keep your argv as a
distinct set of arguments rather than mush everything
together in a string that must be pulled apart again
later.
It's easier to see where each argument begins and ends,
it works better for (and futureproofs against) arguments
that may contain spaces, and can potentially avoid
security issues if some of the input strings contain
unusual sequences of characters, and it even ends up
needing less typing.
I had some questions around the storeddaemon and
events changes. I'd like to hear if anyone has opinions
about that part of the change.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Handle key not found and error accessing store and return 404 or 503 respectively
in all user facing utility functions.
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
None of the plugins exposed sunrpc programs using plugin interface.
Removing unused part from the Plugin interface.
Signed-off-by: Aravinda VK <avishwan@redhat.com>
...except for the tests.
Rundir should be in a place like /var/run which doesn't persist across
reboots. Further some socket files and pid files were in '/var/run' and
few others in '/var/run/gluster'. With this change, everything goes into
the same rundir.
See this bug and fix for some historical context:
https://bugzilla.redhat.com/show_bug.cgi?id=1258561
Signed-off-by: Prashanth Pai <ppai@redhat.com>
* Remove having to specify default error code. It is made implicit
instead. This removes some of the code clutter.
* Support returning multiple errors in a single API response.
Although this will be rarely used, introducing the provision in API
right now is better than later.
* Allow callers to pass both string and error types.
* Introduce a error code map which maps error codes (integers) to their
brief textual description.
Signed-off-by: Prashanth Pai <ppai@redhat.com>
This is an as-is import of sunrpc codec without introducing any
functional code changes. There are few opportunities for cleanup and
optimizations and that'll be done in future.
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Implement self-heal disable API. The API is ineffective
for the time being since self-heal daemon enable is still
waiting for some additions before it becomes operative but
it should work once shd is running successfully.
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
Implement self-heal daemon using the daemon.go interface.
The self-heal daemon will fail to start as the client volfile
glustershd-server.vol is not being generated in GD2 while
create a replicate volume.
Signed-off-by: Vishal Pandey <vpandey@redhat.com>