-
Notifications
You must be signed in to change notification settings - Fork 16
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
Extend logging and fix missing namespace in where clause #153
Conversation
5bef4e7
to
b034d59
Compare
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
==========================================
- Coverage 81.03% 80.84% -0.20%
==========================================
Files 26 26
Lines 1962 1968 +6
==========================================
+ Hits 1590 1591 +1
- Misses 372 377 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM beside the discussed thing...
b034d59
to
0b3ada3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One logging suggestion otherwise LGTM!
If you implement my suggestion from my point of view you can proceed and merge
o.region = i.region | ||
if o.state == StateChoice.DELETED: | ||
logger.error("Update already DELETED instance %s:%s\n\t%s", provider, i.instance_id, i.csp_info) | ||
logger.error("[%s] Update already DELETED instance %s:%s %s", | ||
namespace, provider, i.instance_id, i.all_time_fields()) | ||
if o.state != StateChoice.DELETING: | ||
o.state = StateChoice.ACTIVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o.state = StateChoice.ACTIVE | |
logger.error("[%s] Update and reactivating DELETING instance %s:%s %s", | |
namespace, provider, i.instance_id, i.all_time_fields()) | |
o.state = StateChoice.ACTIVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind that message coming just after this for same instance logger.debug("[%s] Update instance %s:%s", namespace, provider, i.instance_id)
. While I agree with idea to mention instance activation I would suggest different message :
logger.error("[%s] %s:%s instance which still exists has DELETED state in DB. Reactivating %s", namespace, provider, i.instance_id, i.all_time_fields())
bee5ce8
to
07147c7
Compare
Before this PR instance_id was unique in local DB. It appears that people creating same entities in different namespaces. This PR change DB structure and logic around it to be able to handle such flow. Also we extending logging of what actually got deleted.
07147c7
to
6ee2e8b
Compare
No description provided.