mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
feat(client): exit when volume has been marked delete
Signed-off-by: lily-lee <lilylee88756@gmail.com>
This commit is contained in:
parent
47a7953811
commit
74c7211a71
@ -657,8 +657,18 @@ func mount(opt *proto.MountOptions) (fsConn *fuse.Conn, super *cfs.Super, err er
|
||||
volumeInfo, err = mc.AdminAPI().GetVolumeSimpleInfo(opt.Volname)
|
||||
if err != nil {
|
||||
log.LogErrorf("UpdateVolConf: get vol info from master failed, err %s", err.Error())
|
||||
if err == proto.ErrVolNotExists {
|
||||
daemonize.SignalOutcome(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if volumeInfo.Status == proto.VolStatusMarkDelete {
|
||||
err = fmt.Errorf("vol [%s] has been deleted, stop client", volumeInfo.Name)
|
||||
log.LogError(err)
|
||||
daemonize.SignalOutcome(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
super.SetTransaction(volumeInfo.EnableTransaction, volumeInfo.TxTimeout, volumeInfo.TxConflictRetryNum, volumeInfo.TxConflictRetryInterval)
|
||||
if proto.IsCold(opt.VolType) {
|
||||
super.CacheAction = volumeInfo.CacheAction
|
||||
|
||||
@ -21,3 +21,9 @@ const (
|
||||
ReadWrite = 2
|
||||
Unavailable = -1
|
||||
)
|
||||
|
||||
// volume status
|
||||
const (
|
||||
VolStatusNormal uint8 = 0
|
||||
VolStatusMarkDelete uint8 = 1
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user