-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add dbless persistence #8670
Add dbless persistence #8670
Conversation
18dc7d1
to
155a546
Compare
155a546
to
6b02995
Compare
6b02995
to
c595b35
Compare
@bungle is it possible for you to take a closer look at this (to make sure we are not overlooking anything)? Especially make sure the reload doesn't mess up anything. |
assert.res_status(404, res) -- 404, only the declarative config is loaded | ||
end) | ||
|
||
it("doesn't load the persisted lmdb config if a declarative config is set on reload", function() |
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.
For good measure, I think it would be worthwhile to have a test case that covers worker process replacement (kill -9
an existing worker and then validate expected behavior) as well.
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.
@flrgh would you consider this test a blocker? I thought that it will basically do the same thing than an initial worker start, cause the code is right in init_worker
.
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.
Nah I wouldn't go as far as to say it's a blocker. I don't know this code as well as you do, so I think this is up to your discretion whether more tests are needed before merging. To clarify, there's nothing in particular about this changeset that makes me believe it will introduce any new bugs. I just think our test coverage of single worker replacement is lacking overall (it's a very common blind spot I've observed in OpenResty code), so I'll almost always advocate for adding more tests when init_worker
is concerned.
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.
makes sense @flrgh! I will check to add one 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.
@flrgh since I am working on other tasks and we want to unblock as many PR merges as possible before the feature freeze, I will merge this now, but still consider your test case addition is worth to add.
058f19a
to
dc1f746
Compare
This reverts commit c3fbd61.
This reverts commit c3fbd61.
This reverts commit 0c1e2eb.
…""" This reverts commit cf1a91b.
…""" This reverts commit cf1a91b.
This PR makes the dbless persistent between restarts (lmdb). If a config exists in the db, load it and build the router.
With this addition, we can remove the config cache (config.cache.tar.gz) (I will open another PR for this).