diff --git a/cmd/cstor-pool-mgmt/controller/replica-controller/handler.go b/cmd/cstor-pool-mgmt/controller/replica-controller/handler.go index 0b802c224d..ef773d5476 100644 --- a/cmd/cstor-pool-mgmt/controller/replica-controller/handler.go +++ b/cmd/cstor-pool-mgmt/controller/replica-controller/handler.go @@ -648,12 +648,11 @@ func (c *CStorVolumeReplicaController) syncCVRStatus(cvr *apis.CStorVolumeReplic cvr.Status.Capacity = *capacity } - if os.Getenv(string(common.RebuildEstimates)) == "true" { - err = volumereplica.GetAndUpdateSnapshotInfo(c.clientset, cvr) - if err != nil { - return errors.Wrapf(err, "Unable to update snapshot list details in CVR") - } + err = volumereplica.GetAndUpdateSnapshotInfo(c.clientset, cvr) + if err != nil { + return errors.Wrapf(err, "unable to update snapshot list details in CVR") } + return nil } diff --git a/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go b/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go index 5203ed760d..8241da2479 100644 --- a/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go +++ b/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go @@ -766,7 +766,7 @@ func getAndAddPendingSnapshotList( } } - klog.Infof( + klog.V(2).Infof( "Adding %v pending snapshots and deleting %v pending snapshots on CVR %s", newSnapshots, removedSnapshots, @@ -871,7 +871,7 @@ func addOrDeleteSnapshotListInfo( delete(cvr.Status.PendingSnapshots, snapName) } } - klog.Infof( + klog.V(2).Infof( "Adding %v snapshots and deleting %v snapshots on CVR %s", newSnapshots, removedSnapshots, @@ -900,39 +900,21 @@ func getSnapshotInfo(dsName, snapName string) (apis.CStorSnapshotInfo, error) { WithScriptedMode(true). WithParsableMode(true). WithField("value"). - WithProperty("referenced"). - WithProperty("written"). WithProperty("logicalreferenced"). WithProperty("used"). - WithProperty("compressratio"). WithDataset(dsName + "@" + snapName). Execute() if err != nil { return apis.CStorSnapshotInfo{}, errors.Wrapf(err, "failed to get snapshot properties") } valueList := strings.Split(string(ret), "\n") - // Since we made zfs query in following order referenced, written, - // logicalreferenced, used and compressionratio output also will be - // in the same order - - // referenced and written values are of type int64 - var pInt64 []int64 - var valI int64 - for _, v := range []string{valueList[0], valueList[1]} { - valI, err = strconv.ParseInt(v, 10, 64) - if err != nil { - break - } - pInt64 = append(pInt64, valI) - } - if err != nil { - return apis.CStorSnapshotInfo{}, errors.Wrapf(err, "failed to parse the snapshot properties") - } + // Since we made zfs query in following order logicalreferenced, + // used output also will be in the same order // logicalReferenced and Used values are of type uint64 var pUint64 []uint64 var valU uint64 - for _, v := range []string{valueList[2], valueList[3]} { + for _, v := range []string{valueList[0], valueList[1]} { valU, err = strconv.ParseUint(v, 10, 64) if err != nil { break @@ -944,11 +926,9 @@ func getSnapshotInfo(dsName, snapName string) (apis.CStorSnapshotInfo, error) { } snapInfo := apis.CStorSnapshotInfo{ - Referenced: pInt64[0], - Written: pInt64[1], LogicalReferenced: pUint64[0], - Used: pUint64[1], - CompressionRatio: valueList[4], + // TODO: Populate Used value when we are estimating time for rebuild + // Used: pUint64[1], } return snapInfo, nil } diff --git a/pkg/apis/openebs.io/v1alpha1/cstor_volume_replica.go b/pkg/apis/openebs.io/v1alpha1/cstor_volume_replica.go index c90cea685f..12e840a92e 100644 --- a/pkg/apis/openebs.io/v1alpha1/cstor_volume_replica.go +++ b/pkg/apis/openebs.io/v1alpha1/cstor_volume_replica.go @@ -142,18 +142,8 @@ type CStorSnapshotInfo struct { // space consumed by metadata. LogicalReferenced uint64 `json:"logicalReferenced"` - // Written describes the amount of referenced space written to this snapshot - Written int64 `json:"written"` - - // CompressionRatio describes the compression factor of snapshot - CompressionRatio string `json:"compression"` - - // Referenced describes the amount of data that is accessible - // by this snapshot - Referenced int64 `json:"referenced"` - // Used is the used bytes for given snapshot - Used uint64 `json:"used"` + // Used uint64 `json:"used"` } // CStorVolumeCapacityAttr is for storing the volume capacity.