1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00

2404 Commits

Author SHA1 Message Date
Poornima G
54ce5f6f7a blockvolume: Code re-org to fix race condition and cleanup bhv
The block host volume will still exist even when the blocks are all
deleted. Manually deleting block host volume will need another step
of unmounting. With this patch we auto-delete the block host volume
if there are no blocks.

The availablility check of bhv free space is not done within lock, hence
there is a possiblity that the available space has changed by the
time we decide to create the volume. This patch also fixes the race
condition.

Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-03-29 20:30:50 +05:30
Oshank Kumar
9054f74a6b added method for acquiring txn Lock with retry mechanism
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-03-21 16:39:25 +05:30
Kotresh HR
00652479ad Downgrade lvm2, disable lvmetad and dmevent
Downgrade lvm2 to prevent hangs while using udev.

dmeventd was never designed to be executed inside
'container' so there are some assumption about being
there only single instance of running 'dmeventd' on
the whole host system.

Signed-off-by: Kotresh HR <khiremat@redhat.com>
2019-03-21 16:22:06 +05:30
CodeLingo Bot
568322a4b7 Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-03-15 11:34:37 +05:30
Sridhar Seshasayee
82e1c185aa Add gluster-rsyslog Alpine container
This is a lightweight container based on Alpine Linux and run as a
sidecar container in a gcs cluster along with containers running gd2.
This is mainly used to parse gluster specific logs and normalize it for
elastic search. Right now only gd2 logs are parsed to some extent. For
this, an rsyslog configuration along with a rulebase file are included.

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-03-12 16:33:00 +05:30
Kaushal M
dc3d7e054a nightly-contaienr: Switch glusterfs release-6 nightly rpms 2019-03-12 15:45:38 +05:30
Oshank Kumar
73f5bbdeef Check aliveness of all nodes in a single etcd query
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-03-07 20:39:08 +05:30
Oshank Kumar
994aaa0489 broadcast an event on election of cleanup leader
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-02-28 19:16:12 +05:30
Oshank Kumar
829f22ac31 transaction: adding txns under pending-transaction/transaction/ key
initiator will add trasactions under pending-transaction/transaction/
key. Txn Engine keeps a watch on this key for new transactions
and execute transactions.

eg.. etcd key for storing details of a single transaction:-
pending-transaction/transaction/<txn-ID>

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-02-27 00:18:14 +05:30
Oshank Kumar
9093acb370 expose all txn related timeouts as expvars
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-02-21 18:04:08 +05:30
Poornima G
c82180e979 BlockVolume: Reduce the number of clusterlocks
Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-02-21 09:49:55 +05:30
Poornima G
2869f88344 BlockVolume: Input block host volume properties in block create request
Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-02-21 09:49:55 +05:30
Oshank Kumar
a94bec26fc tracing: refactor tracing code in transaction
Decouples tracing code from RunStepFuncLocally() func and
added a middleware which implements transaction.StepManager
to trace step funcs. This will provide a better trace
management and clean code.

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-02-20 16:15:05 +05:30
Oshank Kumar
f46dee66ce fixed Merge conflicts and added a middleware in txn Executor
to record trace information

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-02-18 10:28:24 +05:30
Oshank Kumar
698448f229 transaction: refactor txn.Do() method
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-02-18 10:28:24 +05:30
Oshank Kumar
c3b0cc3f1e transaction: resume txn if a peer restarts
If a peer restarts then it should check for pending
transactions and resume all the pending transaction.

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-02-18 10:28:24 +05:30
Aravinda VK
17bc6f49cc Added max limit for loopback brick size
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2019-02-14 10:49:17 +05:30
Aravinda VK
bebbc65052 Support for loopback bricks
Register the Bricks hosting directory using,

```
glustercli device add <peerid> <path> --provisioner loop
```

Example:

```
glustercli device add 70d79c3f-e7af-43f6-8b65-05dff2423da1 \
	   /exports --provisioner loop
```

Now create the volume using,

```
glustercli volume create gv1 --size 1G \
	   --provisioner loop \
	   --replica 3
```

Fixes: #1418
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2019-02-14 10:49:17 +05:30
Sridhar Seshasayee
830c8c9ff0 Tracing: Generate new endpoints.md with new tracing endpoints.
closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
ec25ca6619 Tracing: Implement glustercli command to disable the trace configuration
Implement glustercli command to disable and delete the current tracing
configuration on the cluster. The changes include gd2 transaction that
first deletes the trace configuration from the store on one node and then
a subsequent step clears the in-memory trace configuration on all nodes.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
219ce69b48 Tracing: Implement glustercli command to update the trace configuration
Implement glustercli command to update the current tracing status on the
cluster. All trace config options are passed as flags to the command. If
any option is not passed, the existing value for that option will be
retained.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
4c65b6f95a Tracing: Implement glustercli command to get current tracing status
Implement glustercli command to get the current tracing status on the
cluster. The tracing info is read from the store and presented to the
user in table format with info like Status, Jaeger Endpoints, Sampler
type and sample fraction. For e.g.,

+------------------------+----------------------------+
|      TRACE OPTION      |           VALUE            |
+------------------------+----------------------------+
| Status                 | enabled                    |
| Jaeger Endpoint        | http://192.168.122.1:14268 |
| Jaeger Agent Endpoint  | http://192.168.122.1:6831  |
| Jaeger Sampler         | 2 (Probabilistic)          |
| Jaeger Sample Fraction | 0.99                       |
+------------------------+----------------------------+

Add "trace enable" e2e test cases. The tests also exercise the
"trace status" request.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
6158f4a040 Tracing: Implement glustercli command to enable tracing
Implement glustercli command to enable tracing. The rest client performs
basic checks of the tracing options prior to sending the request.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
2a5df76893 Tracing: Apply trace config from store if present on GD2 start-up
If no start-up options are specified (i.e. command line or config file),
but a valid trace config exists in the store, then read the config as
part of GD2 start-up sequence and apply the trace config on the node that
is coming up. This way, all the GD2 nodes read the trace configuration
and apply it on themselves on start-up. This scenario is applicable when,
 - trace configuration was applied via glustercli (not start-up config)
   and,
 - GD2 node(s) restart for some reason. If there's a valid trace config
   in the store, then it must be applied when a node comes up.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
fc9596d555 Tracing: Implement Undo step for trace enable transaction.
Implement the undo step for trace enable transaction. This
step removes the trace configuration from the store if
written.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
76a5a9f928 Tracing: Implement gd2 plugin that enables tracing across the cluster.
This commit implements a gd2 plugin that allows management of tracing
operations across the cluster. This change-set implements the server side
handling of the request to enable tracing on all gd2 nodes. The
pre-condition to execute this transaction is that there shouldn't be any
existing trace configuration in etcd. The steps
involved in the transaction are,
 1. Node receiving the request Validates the passed tracing configuration,
 2. Node Stores the tracing configuration in etcd, and,
 3. Set the in-memory trace configuration on all nodes

Failure in steps 2 and 3 will result in the undo logic restoring the
previous configuration both in memory and in etcd.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
3e4f7a1b07 Tracing: Introduce new Jaeger trace config options and management logic.
The new client configurable options that allows trace control are,

jaeger-sampler:
---------------
This option can take any one of the following values. Each value
maps to,
 - 0 (Never): Disable tracing.
 - 1 (Always): Samples all traces.
 - 2 (Probabilistic): A probabilistic sampler. Sample traces based on
   an additional option called "sampling fraction" described below using
   which Jaeger decides whether to trace the operation or not.

jaeger-sample-fraction:
-----------------------
If "jaeger-sampler-type" is set to 2 (probabilistic), then an option to
set the sampling fraction (or frequency) can be specified. By default this
value is set to 0.1 (i.e. sample every 1 in 10 traces). Valid values for
this option ranges from >0.0 and <1.0. Higher the value, the greater the
probability that a trace is sampled. This allows a control on the volume
of traces captured in a highly scaled environment.

Other changes in this commit:
- Encapsulate Jaeger specific trace configuration information in a separate
structure that is instantiated only once and updated subsequently.

- Factor out code that validates and sets trace config information into
separate functions for other modules to re-use.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
520305c9f0 Tracing: Include span info in transactionv2 Txn structure.
Include spanContext structure within the main Txn structure that contains
all important information about a transaction. The spanContext is used to
track the parent or the root span of the transaction. This is necessary to
build the entire span tree for the transaction in question.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
31c7e8a065 Tracing: Remove hardcoded option to always sample traces in ocgrpc handlers
Remove the option to always sample traces within the ocgrpc server and
client handler. The global sampler option provided via CLI or config file
should take precedence.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Poornima G
9aed7a59a5 Gluster-virtblock: Improve the GET/DELETE blocks api performance
Currently, to GET/DELETE any block volume we mount all the block hosting
volumes and readdir all the volumes, and loop through it, to find the
block hosting volume, the block belongs to. This approach is not scalable.
Hence, in the metadata of the block hosting volume, we keep a list of all
the block volumes present in that host volume. This way, GET/DELETE walks
through the volume metadata rather than the readdir.

Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-02-07 18:54:31 +05:30
Poornima G
df3f7a764c Fix auto creation of block host volume
When the block host cluster options are set to values other
than default, the block volume creation fails on the first
attempt, but succeeds on the subsequent attempts. This is
due to the initialization of block vol create req before
reading the cluster options. In this patch, change the order
of the same to fix the issue.

Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-02-07 18:54:31 +05:30
Oshank Kumar
a37193deab Initialize config and logging before main() starts to execute
initialize config followed by initializing logging before execution
of main() function will prevent redirecting of logs in init() func
of other packages to console.

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-29 11:23:19 +05:30
Oshank Kumar
9c6ee47f50 blockvolume: change log level from info to debug in RegisterProvider func
closes #1475

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-29 11:23:19 +05:30
Aravinda VK
fff7c211e7 xlators default orders and volume default options
Xlator order for client volfile changed to,

```
debug/io-stats
performance/read-ahead
performance/io-threads
performance/nl-cache
performance/quick-read
performance/open-behind
performance/io-cache
performance/readdir-ahead
performance/write-behind
performance/md-cache
features/utime
features/shard
cluster/distribute
```

This PR also disables Self heal by default.(Fixes: #1485)

Signed-off-by: Aravinda VK <avishwan@redhat.com>
2019-01-28 11:53:07 +05:30
Oshank Kumar
ca3d113915 use cluster-options for host volume configuration
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-24 13:23:47 +05:30
Aravinda VK
13757cfa33 Fix thin arbiter Option name
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2019-01-24 12:05:12 +05:30
rishubhjain
445cdb9256 Fixing volume set options functionality
Fixes:#1445

Signed-off-by: rishubhjain <rishubhjain47@gmail.com>
2019-01-22 09:32:19 +05:30
Kotresh HR
f4692484ae Fix restclient api gluster virtblock
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2019-01-21 10:23:42 +05:30
Kotresh HR
d51f60b084 gluster-virtblock: Rename to virtual block
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2019-01-17 16:48:43 +05:30
Poornima G
4103a89b66 Add resclient api for block volume
Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-01-16 15:22:15 +05:30
Poornima G
8034fbdd10 Add loopback block provider
Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-01-16 15:22:15 +05:30
Aravinda VK
5800472c20 Skip local bricks path validation if auto provisioned volume
Brick paths are generated while creating smart volume using volume
name, subvol number and brick number. So collision will not happen
when multiple smart volumes are created.

Signed-off-by: Aravinda VK <avishwan@redhat.com>
2019-01-16 14:12:37 +05:30
Vishal Pandey
1353b0e79f Set options metadata-self-heal, entry-self-heal and data-self-heal in glustershd e2e tests
to successfully heal. Change introduced in https://review.gluster.org/#/c/glusterfs/+/21938/.
The above three options are not set to off by default in glustershd volfile.

Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2019-01-16 13:54:59 +05:30
Vishal Pandey
dfb24628dc Improve brick mux e2e test suite. Handle cases causing spurious failures
in brickmux tests. Increase waiting time for bricks to sign in and
add sleep whereever a new gd2 instance is respawned to give enough time
to bricks to sign in properly and multiplex.

Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2019-01-10 20:07:49 +05:30
Oshank Kumar
79d998788e transaction: increase timeout fot transaction
- increase timeout for txn to get complete to 3 Minutes
   and sync timeout to 2 Minutes.

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-09 14:07:49 +05:30
Aravinda VK
c896a94589 Skip lvs command during thinpool delete
If a Volume is cloned from another volume, the bricks of cloned volume
will also belong to same LV thinpool as the original Volume. So before
removing the thinpool a check was made to confirm if number of Lvs in
that thinpool is zero. This check was causing hang when parallel
Volume delete commands were issued.

With this PR, number of Lvs check is removed, instead of that captured
the failure of thinpool delete and handled it gracefully.

This PR also adds support for gracefully delete the volume if lv or
thinpool already deleted by previous failed transaction or manual delete.

Signed-off-by: Aravinda VK <avishwan@redhat.com>
2019-01-08 15:39:39 +05:30
Oshank Kumar
8ef2e187de block volume: added a common function for updating available hosting volume size
- moved hosts parameter from mandatory to optional field in  CreateBlockVolume
   method of BlockProvider interface,since hosts field may not required for
   other block providers like loopback.

 - a common function for updating available hosting volume size will prevent
   from duplicate code

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-07 19:04:12 +05:30
Oshank Kumar
9bd5bc9173 block volume: Fix Merge conflicts in volume-start.go
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-07 19:04:12 +05:30
Oshank Kumar
cf94e9f39c update dependencies using dep ensure
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-07 19:04:12 +05:30
Oshank Kumar
12aef05756 block-volume: change size type from int64 to uint64
Signed-off-by: Oshank Kumar <okumar@redhat.com>
2019-01-07 19:04:12 +05:30