Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick some pull request to release2.7 #2911

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion curvefs/docker/debian11/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ function prepare() {
}

function create_directory() {
chmod 700 "$g_prefix/data"
if [ "$g_role" != "monitor" ]; then
chmod 700 "$g_prefix/data"
fi

if [ "$g_role" == "etcd" ]; then
mkdir -p "$g_prefix/data/wal"
elif [ "$g_role" == "metaserver" ]; then
Expand Down
5 changes: 4 additions & 1 deletion curvefs/docker/openeuler/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ function prepare() {
}

function create_directory() {
chmod 700 "$g_prefix/data"
if [ "$g_role" != "monitor" ]; then
chmod 700 "$g_prefix/data"
fi

if [ "$g_role" == "etcd" ]; then
mkdir -p "$g_prefix/data/wal"
elif [ "$g_role" == "metaserver" ]; then
Expand Down
1 change: 1 addition & 0 deletions curvefs/src/client/s3/disk_cache_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ void DiskCacheManager::TrimCache() {
cacheWriteFullDir = GetCacheWriteFullDir();
while (true) {
UpdateDiskFsUsedRatio();
waitIntervalSec_.Init(FLAGS_diskTrimCheckIntervalSec * 1000);
waitIntervalSec_.WaitForNextExcution();
if (!isRunning_) {
LOG(INFO) << "trim thread end.";
Expand Down
5 changes: 4 additions & 1 deletion docker/debian11/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ function prepare() {
}

function create_directory() {
chmod 700 "$g_prefix/data"
if [ "$g_role" != "monitor" ]; then
chmod 700 "$g_prefix/data"
fi

if [ "$g_role" == "etcd" ]; then
mkdir -p "$g_prefix/data/wal"
elif [ "$g_role" == "client" ]; then
Expand Down
5 changes: 4 additions & 1 deletion docker/openeuler/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ function prepare() {
}

function create_directory() {
chmod 700 "$g_prefix/data"
if [ "$g_role" != "monitor" ]; then
chmod 700 "$g_prefix/data"
fi

if [ "$g_role" == "etcd" ]; then
mkdir -p "$g_prefix/data/wal"
elif [ "$g_role" == "client" ]; then
Expand Down
18 changes: 15 additions & 3 deletions tools-v2/internal/error/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,12 @@ var (
ErrBsListZone = func() *CmdError {
return NewInternalCmdError(39, "list zone fail. the error is %s")
}

ErrBsDeleteFile = func() *CmdError {
return NewInternalCmdError(40, "delete file fail. the error is %s")
}

ErrRespTypeNoExpected = func() *CmdError {
return NewInternalCmdError(41, "the response type is not as expected, should be: %s")
}

ErrGetPeer = func() *CmdError {
return NewInternalCmdError(42, "invalid peer args, err: %s")
}
Expand Down Expand Up @@ -487,6 +484,21 @@ var (
ErrBsGetFormatStatus = func() *CmdError {
return NewInternalCmdError(75, "get format status fail, err: %s")
}
ErrBsGetSegmentInfo = func() *CmdError {
return NewInternalCmdError(76, "get segment info fail, err: %s")
}
ErrBsGetChunkHash = func() *CmdError {
return NewInternalCmdError(77, "get chunk hash fail, err: %s")
}
ErrBsListSnaspshot = func(requestId, code, message string) *CmdError {
return NewInternalCmdError(78, fmt.Sprintf("list snapshot fail, requestId: %s, code: %s, message: %s", requestId, code, message))
}
ErrBsGetCloneRecover = func() *CmdError {
return NewInternalCmdError(79, "get clone-recover fail, err: %s")
}
ErrInvalidMetaServerAddr = func() *CmdError {
return NewInternalCmdError(80, "invalid metaserver external addr: %s")
}

// http error
ErrHttpUnreadableResult = func() *CmdError {
Expand Down
3 changes: 1 addition & 2 deletions tools-v2/pkg/cli/command/curvefs/status/copyset/copyset.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ func (cCmd *CopysetCommand) Init(cmd *cobra.Command, args []string) error {
poolIdVec = append(poolIdVec, fmt.Sprintf("%d", info.GetPoolId()))
}
if len(copysetIdVec) == 0 {
var err error
cCmd.Error = cmderror.ErrSuccess()
cCmd.Result = "No copyset found"
cCmd.health = cobrautil.HEALTH_OK
return err
return nil
}
copysetIds := strings.Join(copysetIdVec, ",")
poolIds := strings.Join(poolIdVec, ",")
Expand Down
1 change: 1 addition & 0 deletions tools-v2/pkg/cli/command/curvefs/status/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func (eCmd *EtcdCommand) Init(cmd *cobra.Command, args []string) error {
// set main addr
etcdAddrs, addrErr := config.GetFsEtcdAddrSlice(eCmd.Cmd)
if addrErr.TypeCode() != cmderror.CODE_SUCCESS {
eCmd.Error = addrErr
return fmt.Errorf(addrErr.Message)
}
for _, addr := range etcdAddrs {
Expand Down
2 changes: 2 additions & 0 deletions tools-v2/pkg/cli/command/curvefs/status/mds/mds.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ func (mCmd *MdsCommand) Init(cmd *cobra.Command, args []string) error {
// set main addr
mainAddrs, addrErr := config.GetFsMdsAddrSlice(mCmd.Cmd)
if addrErr.TypeCode() != cmderror.CODE_SUCCESS {
mCmd.Error = addrErr
return fmt.Errorf(addrErr.Message)
}

// set dummy addr
dummyAddrs, addrErr := config.GetFsMdsDummyAddrSlice(mCmd.Cmd)
if addrErr.TypeCode() != cmderror.CODE_SUCCESS {
mCmd.Error = addrErr
return fmt.Errorf(addrErr.Message)
}
for _, addr := range dummyAddrs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ func (mCmd *MetaserverCommand) Init(cmd *cobra.Command, args []string) error {

for i, addr := range externalAddrs {
if !config.IsValidAddr(addr) {
return fmt.Errorf("invalid metaserver external addr: %s", addr)
mCmd.Error = cmderror.ErrInvalidMetaServerAddr()
mCmd.Error.Format(addr)
return fmt.Errorf(mCmd.Error.Message)
}

// set metrics
Expand Down