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

feat: add real size to backing image #3104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChanYiLin
Copy link
Contributor

ref: longhorn/longhorn#8757

  • store realsize of backingimage in status
  • add the realsize to storageScheduled in diskStatus
  • add new field scheduledBackingImage in diskStatus

@ChanYiLin ChanYiLin self-assigned this Aug 26, 2024
@ChanYiLin ChanYiLin force-pushed the LH8757_record_backing_image_real_size branch 2 times, most recently from d282af0 to c22ca97 Compare August 26, 2024 13:42
Copy link

mergify bot commented Aug 26, 2024

This pull request is now in conflict. Could you fix it @ChanYiLin? 🙏

@ChanYiLin
Copy link
Contributor Author

Pending

Wait for

@ChanYiLin ChanYiLin force-pushed the LH8757_record_backing_image_real_size branch 3 times, most recently from 1a5db6c to a82928a Compare September 24, 2024 06:41
@ChanYiLin ChanYiLin marked this pull request as ready for review September 24, 2024 06:45
@ChanYiLin
Copy link
Contributor Author

Hi @derekbit @shuo-wu
This PR is ready for review, thanks!

@ChanYiLin ChanYiLin force-pushed the LH8757_record_backing_image_real_size branch 3 times, most recently from 9c0468a to 6a00d8f Compare September 24, 2024 08:48
if info.RealSize > 0 {
if bi.Status.RealSize == 0 {
bi.Status.RealSize = info.RealSize
bic.eventRecorder.Eventf(bi, corev1.EventTypeNormal, constant.EventReasonUpdate, "Set realSize to %v", bi.Status.RealSize)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need an event for the update?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this update. Backing image actual/real size update should be an one-time update.

Copy link
Contributor

@shuo-wu shuo-wu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general LGTM

if info.RealSize > 0 {
if bi.Status.RealSize == 0 {
bi.Status.RealSize = info.RealSize
bic.eventRecorder.Eventf(bi, corev1.EventTypeNormal, constant.EventReasonUpdate, "Set realSize to %v", bi.Status.RealSize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this update. Backing image actual/real size update should be an one-time update.

if bi.Status.DiskFileStatusMap[bim.Spec.DiskUUID].State != longhorn.BackingImageStateFailed {
msg := fmt.Sprintf("found mismatching realSize %v reported by backing image manager %v in disk %v, the realSoze recorded in status is %v",
info.RealSize, bim.Name, bim.Spec.DiskUUID, bi.Status.RealSize)
log.Error(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Use bic.eventRecorder

Copy link
Member

@derekbit derekbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, LGTM. After resolving the comments, we can merge the PR.

}
if bi.Status.RealSize != info.RealSize {
if bi.Status.DiskFileStatusMap[bim.Spec.DiskUUID].State != longhorn.BackingImageStateFailed {
msg := fmt.Sprintf("found mismatching realSize %v reported by backing image manager %v in disk %v, the realSoze recorded in status is %v",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg := fmt.Sprintf("found mismatching realSize %v reported by backing image manager %v in disk %v, the realSoze recorded in status is %v",
msg := fmt.Sprintf("found mismatching realSize %v reported by backing image manager %v in disk %v, the realSize recorded in status is %v",

ref: longhorn/longhonr 8757

Signed-off-by: Jack Lin <jack.lin@suse.com>
@derekbit derekbit force-pushed the LH8757_record_backing_image_real_size branch from 6a00d8f to 7f7861b Compare September 27, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants