-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix(src): validation log with notice level #49
Conversation
233a3ef
to
7d49fc8
Compare
src/ngx_lua_resty_lmdb_module.c
Outdated
@@ -539,7 +539,7 @@ static ngx_int_t ngx_lua_resty_lmdb_init(ngx_cycle_t *cycle) | |||
if (ngx_lua_resty_lmdb_validate(cycle, lcf) != NGX_OK) { | |||
ngx_lua_resty_lmdb_close_file(cycle, lcf); | |||
|
|||
ngx_log_error(NGX_LOG_WARN, cycle->log, 0, | |||
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, |
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.
I want this to be more visible as wiping the database is a destructive operation. Why would this message occur in our tests anyway? We are not testing the upgrade in integration tests.
Also, could you test by changing the .requirments
file to point to this branch and shows the test passes? I want to make sure this PR is good before merging.
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.
When kong first start, there is no tag in lmdb, and we have set validation tag in nginx-kong.conf, so the C module will wipe the lmdb database and leave a log message.
If the log is warning level, it will break the test case in spec/02-integration/02-cmd/02-start_stop_spec.lua
.
assert.logfile().has.no.line("[warn]", true)
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.
PR Kong/kong#12026 is using this branch.
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.
Perhaps we could add another condition:
if the lmdb database is empty then write the tag into database and don't think it is an warning.
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.
done.
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.
if the lmdb database is empty then write the tag into database and don't think it is an warning.
THis should not be necessary, for our use case we can assume lack of tag = empty database. We do not concern compatibility with other LMDB using applications.
#34 introduced a new directive
lmdb_validation_tag
, but the mismatch log levelWARN
is too high,this PR change the log level to
NOTICE
.This may fix the ci test: https://github.com/Kong/kong/actions/runs/6876582885/job/18702488766
Related PR: Kong/kong#12026