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

79 lines
5.8 KiB
Go
Raw Permalink Normal View History

package errors
import (
"errors"
)
// Different error macros
var (
ErrVolCreateFail = errors.New("unable to create volume")
ErrVolNotFound = errors.New("volume not found")
ErrVolNotStarted = errors.New("volume not started")
ErrPeerNotFound = errors.New("peer not found")
ErrJSONParsingFailed = errors.New("unable to parse the request")
ErrEmptyVolName = errors.New("volume name is empty")
ErrInvalidVolName = errors.New("invalid volume name")
ErrEmptyBrickList = errors.New("brick list is empty")
ErrInvalidBrickPath = errors.New("invalid brick path, brick path should be in host:<brick> format")
ErrVolExists = errors.New("volume already exists")
ErrVolAlreadyStarted = errors.New("volume already started")
ErrVolAlreadyStopped = errors.New("volume already stopped")
ErrWrongGraphType = errors.New("graph: incorrect graph type")
ErrDeviceIDNotFound = errors.New("failed to get device id")
ErrBrickIsMountPoint = errors.New("brick path is already a mount point")
ErrBrickUnderRootPartition = errors.New("brick path is under root partition")
ErrBrickNotDirectory = errors.New("brick path is not a directory")
ErrBrickPathAlreadyInUse = errors.New("brick path is already in use by other gluster volume")
ErrNoHostnamesPresent = errors.New("no hostnames present")
ErrBrickPathConvertFail = errors.New("failed to convert the brickpath to absolute path")
ErrBrickNotLocal = errors.New("brickpath doesn't belong to localhost")
ErrBrickPathTooLong = errors.New("brickpath too long")
ErrSubDirPathTooLong = errors.New("sub directory path is too long")
ErrIPAddressNotFound = errors.New("failed to find IP address")
ErrPeerLocalNode = errors.New("peer being added is the local node")
ErrProcessNotFound = errors.New("process is not running or is inaccessible")
ErrProcessAlreadyRunning = errors.New("process is already running")
ErrBitrotAlreadyEnabled = errors.New("bitrot is already enabled")
ErrBitrotAlreadyDisabled = errors.New("bitrot is already disabled")
ErrBitrotNotEnabled = errors.New("bitrot is not enabled")
ErrQuotadNotRunning = errors.New("quotad is not running")
ErrQuotadNotEnabled = errors.New("quotad is not enabled")
ErrUnknownValue = errors.New("unknown value specified")
ErrGetFailed = errors.New("failed to get value from the store")
ErrUnmarshallFailed = errors.New("failed to unmarshall from json")
ErrClusterOptionsNotFound = errors.New("cluster options not found in store")
ErrDuplicateBrickPath = errors.New("duplicate brick entry")
ErrRestrictedKeyFound = errors.New("key names starting with '_' are restricted in metadata field")
ErrVolFileNotFound = errors.New("volume file not found")
ErrEmptySnapName = errors.New("snapshot name is empty")
ErrSnapExists = errors.New("snapshot already exists")
ErrSnapNotFound = errors.New("snapshot not found")
ErrSnapNotActivated = errors.New("snapshot not activated")
ErrSnapDeactivated = errors.New("snapshot is already deactivated")
ErrInvalidVolFlags = errors.New("invalid volume flags")
ErrMetadataSizeOutOfBounds = errors.New("metadata size exceeds max allowed size of 4KB")
ErrFetchingVolfileContent = errors.New("unable to fetch volfile content")
ErrPidFileNotFound = errors.New("pid file not found")
ErrInvalidSnapName = errors.New("invalid snapshot name")
ErrInvalidClusterOption = errors.New("invalid cluster option key")
ErrInvalidVolFileTmplNamespace = errors.New("invalid template namespace")
ErrInvalidVolFileTmplName = errors.New("invalid template name")
ErrDeviceNameNotFound = errors.New("device name not found")
ErrInvalidSplitBrainOp = errors.New("invalid split-brain operation specified")
ErrInvalidHostName = errors.New("hostname doesn't exist")
ErrInvalidBrickName = errors.New("brick doesn't exist on this host")
ErrFilenameNotFound = errors.New("please specify filename for split-brain operation")
ErrInvalidFilenameFormat = errors.New("filename should be an absolute path in volume, should start with / notation")
ErrHostOrBrickNotFound = errors.New("please specify hostname and brick path to resolve split-brain")
ErrVolTypeNotInReplicateOrDisperse = errors.New("invalid operation: the volume is not a replicate or disperse volume")
ErrDeviceNotFound = errors.New("device does not exist in the given peer")
ErrVolumeBricksMountFailed = errors.New("failed to get mount point entries for the volume bricks")
ErrBrickMountFailed = errors.New("failed to mount brick")
ErrReservedGroupProfile = errors.New("reserved group profile")
Implement max-bricks-per-process option for brick multiplexing. The implementation is an extension to brick-multiplexing. The max-bricks-per-process is being monitored by using entries in pmap corresponding to a particular port. So, If a brick needs to be multiplexed following are the series of steps that needs to be followed. The following are the genralised sets of steps - - look into all started volumes with same options as the current volume(one by one) - traverse through all local bricks of taregtVolume - find the port of the local brick by using its path - look for number of entries in pmap corresponding to particular port No. and count num of bricks already attached to that port - If the number of bricks attached to a port is less that max-bricks-per-process constraint - Then we have our target brick or repeat from step 1 until all targetVolumes are covered. - Since current volume is not considered into started volumes list, so if we don't have any target brick yet from any of the started volumes then - look for any target brick in the current volume - If even the current volume doesn't have any target brick then - start seperate glusterfsd. Cases Handles in this PR and approach followed - 1- If no started volume already present - check current volume for target brick - if taregt brick not found, start seperate glusterfsd 2- If atleast one started volume present - if Target volume found, out of all the started volumes * if target brick found, attach to the brick * if taregt brick not found, look through other taregt volumes * if still target brick not found, look into current volume * if still taregt brick not found, start seperate glusterfsd process - if target Volume not found * look into current volume for any target bricks * if taregt brick not found, start seperate glusterfsd Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-12-06 23:55:51 +05:30
ErrInvalidIntValue = errors.New("error parsing the value. Make sure the value is a valid integer")
ErrConnectingHost = errors.New("could not connect to host. Make sure host address is valid, network connection is active and gd2 is up and running")
ErrBlockVolNotFound = errors.New("block volume not found")
ErrBlockHostVolNotFound = errors.New("block hosting volume not found")
ErrSnapNotSupported = errors.New("snapshot not supported")
)