Skip to content

Take string view arguments in cache processor #12147

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

hnakamur
Copy link
Contributor

@hnakamur hnakamur commented Apr 1, 2025

No description provided.

@cmcfarlen cmcfarlen added this to the 10.2.0 milestone Apr 7, 2025
@bneradt bneradt requested a review from cmcfarlen April 7, 2025 22:27
cmcfarlen
cmcfarlen previously approved these changes Apr 14, 2025
@cmcfarlen
Copy link
Contributor

I don't think this PR changes layout of any disk-stored structs.

@hnakamur
Copy link
Contributor Author

Yes, I agree with you. This PR changes the field of struct CacheVC but I suppose it is not stored on disk.

I found this branch has conflicts from with changes from Cleanup: Remove unused args from open_read and open_write by masaori335 · Pull Request #12181 · apache/trafficserver.
I merged master to the copy of this branch, resolved conflicts and pushed it to https://github.com/hnakamur/trafficserver/tree/take_string_view_arguments_in_cache_processor2.

Can I foward this branch to f7e77f9?

@masaori335
Copy link
Contributor

masaori335 commented Apr 16, 2025

We're going to do "squash & merge" to merge this PR, so forwarding this branch to f7e77f9 should be fine. Please push the change, let's see what diff shows.

@hnakamur
Copy link
Contributor Author

Oops, I found I created the https://github.com/hnakamur/trafficserver/tree/take_string_view_arguments_in_cache_processor2 from the wrong branch.
I'm going to fix it later today.

@@ -281,8 +281,7 @@ struct CacheVC : public CacheVConnection {
int fragment;
int scan_msec_delay;
CacheVC *write_vc;
char *hostname;
int host_len;
std::string_view hostname;
Copy link
Contributor

Choose a reason for hiding this comment

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

@cmcfarlen This is part of "Region C". Can we change this? IIRC, I broke cache compatibility by changing type in this region.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bneradt do you remember what you faced with time_t pin_in_cache?
#11013

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you are correct about the pin_in_cache issue. Coverity reports type issues on that pin_in_cache. Two different commits went in to change its type to address the coverity warning (not just your commit, @masaori335 ). When that got changed to a 64 bit type rather than a 32 bit one, it resulted in cache incompatibility. Upgrading through that change would result in many warnings about cache inconsistency.

@masaori335 is correct to be leary of this change. Maybe it would be fine? What are the underlying types of a string_view - if they are char* and int anyway, maybe it won't cause issues? But we would want to upgrade a box with cached items to test this and verify there are not cache inconsistency warnings.

Copy link
Contributor

@masaori335 masaori335 left a comment

Choose a reason for hiding this comment

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

Let me check this doesn't break cache compatibility.

@hnakamur
Copy link
Contributor Author

@masaori335

Let me check this doesn't break cache compatibility.

Thank you. I'll revert the change in struct CacheVC if it causes cache incompatibility.

We're going to do "squash & merge" to merge this PR, so forwarding this branch to f7e77f9 should be fine. Please push the change, let's see what diff shows.

The merge commit f7e77f9 contains the changes in other branches which were merged to master. However the diff betwen master and f7e77f9 master...hnakamur:f7e77f9 contains only changes in this branch.

So I think it should be OK to forward this branch to f7e77f9.

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

Successfully merging this pull request may close these issues.

5 participants