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 extra time that prevents from instantly suspending out of quota kafkas #1716

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pawelpaszki
Copy link
Contributor

feat: add extra time that prevents from instantly suspending out of quota kafkas

Description

Verification Steps

Checklist (Definition of Done)

  • All acceptance criteria specified in JIRA have been completed
  • Unit and integration tests added that prove the fix is effective or the feature works (tested against emulated and non-emulated OCM environment)
  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer
  • All PR comments are resolved either by addressing them or creating follow up tasks
  • Required metrics/dashboards/alerts have been added (or PR created).
  • Required Standard Operating Procedure (SOP) is added.
  • JIRA has been created for changes required on the client side

@github-actions github-actions bot added the kafka label Apr 18, 2023
@@ -440,7 +440,7 @@ func (k *KafkaManager) updateExpiresAtBasedOnQuotaEntitlement(kafka *dbapi.Kafka
}

// set expires_at to now + grace period days
Copy link
Contributor

Choose a reason for hiding this comment

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

the comment needs to be updated as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. I will update it. I also need to add code to remove expiration if quota is now > 0

@@ -440,7 +440,7 @@ func (k *KafkaManager) updateExpiresAtBasedOnQuotaEntitlement(kafka *dbapi.Kafka
}

// set expires_at to now + grace period days
expiresAtTime := time.Now().AddDate(0, 0, billingModel.GracePeriodDays)
expiresAtTime := time.Now().AddDate(0, 0, billingModel.GracePeriodDays).Add(time.Hour * 12)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question for my understanding: How was the 12 hours period choosen? And how is it different to grace period?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was jus an arbitrary number of hours, so kafkas won't be instantly suspended if allowed quota intermittently shows 0

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification. Might be good to extract the "magic" number onto a const/variable with a proper name and comment if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense. will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants