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

DPL CCDB: handle the Cache-Valid-Until header #12801

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

ktf
Copy link
Member

@ktf ktf commented Mar 4, 2024

DPL CCDB: handle the Cache-Valid-Until header

This will not recheck the etag and consider the cache valid until
the timestamp in milliseconds in the Cache-Valid-Until is not passed
by the data timestamp.

@ktf ktf requested a review from a team as a code owner March 4, 2024 09:41
Copy link
Contributor

github-actions bot commented Mar 4, 2024

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass
async-2023-pp-apass1
async-2022-pp-apass6
async-2022-pp-apass4
async-mc
async-data

@ktf
Copy link
Member Author

ktf commented Mar 4, 2024

@costing @shahor02 attempt at supporting Cache-Valid-Until header in the CCDB Reply. One thing it's not clear to me is the unit of Cache-Valid-Until. Is it milliseconds?

@ktf ktf force-pushed the pr12801 branch 2 times, most recently from 18c9baa to f355f45 Compare March 4, 2024 14:55
@@ -240,6 +250,7 @@ auto populateCacheWith(std::shared_ptr<CCDBFetcherHelper> const& helper,
helper->mapURL2UUID[path].lastCheckedTF = timingInfo.tfCounter;
if (etag.empty()) {
helper->mapURL2UUID[path].etag = headers["ETag"]; // update uuid
helper->mapURL2UUID[path].cacheValidUntil = headers["Cache-Valid-Until"].empty() ? 0 : std::stoul(headers["Cache-Valid-Until"]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It appears that this "Cache-Valid-Until" is provided not at the 1st query (with empty etag) and at the 1st query with valid etag (actually at the 2nd one, see my email to @costing ).
So, there is no point in its caching here, instead should be cached as done here

helper->mapURL2UUID[path].cacheValidUntil = headers["Cache-Valid-Until"].empty() ? 0 : std::stoul(headers["Cache-Valid-Until"]);
and also here as

else {
  helper->mapURL2UUID[path].cacheValidUntil = headers["Cache-Valid-Until"].empty() ? 0 : std::stoul(headers["Cache-Valid-Until"]);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

@shahor02 updated.

@ktf ktf force-pushed the pr12801 branch 2 times, most recently from db18c53 to db34e43 Compare March 5, 2024 08:35
This will not recheck the etag and consider the cache valid until
the timestamp in milliseconds in the Cache-Valid-Until is not passed
by the data timestamp.
@ktf ktf merged commit fcd565d into AliceO2Group:dev Mar 11, 2024
19 checks passed
@ktf
Copy link
Member Author

ktf commented Mar 11, 2024

Passes the full system test.

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

Successfully merging this pull request may close these issues.

2 participants