-
Notifications
You must be signed in to change notification settings - Fork 851
Lost fragments table when update object in Cache #5342
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
Conversation
|
[approve ci] |
iocore/cache/CacheWrite.cc
Outdated
| if (alternate_index >= 0) { | ||
| alternate.copy_frag_offsets_from(write_vector->get(alternate_index)); | ||
| /*if length changed, fragment offset also need to change, if not cause range request error*/ | ||
| if (total_len != write_vector->get(alternate_index)->object_size_get()) { |
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.
Sometime we try to update the header only fragment that means we won't write any fragment in it. So the total_len is always 0 in this situation. And we will lost the fragments info forever if we don't copy the fragments table from old info.
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.
There is situation that first response code is 404 and next response code is 200,so the total_len has changed to non zero.In this situation,this cause data read error.
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.
But it affect the normal requests.
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.
You can test this situation.
|
Besides fixing the build problems, can you also please make a more descriptive (but < 50 character) Subject line for this PR? Summarizing the more descriptive text in the commit. |
|
[approve ci]. |
|
[approve ci] |
|
I won't approve this pr because it break the header update only case. As I comment above, some header update object will lost the fragments table forever. For your case. My question is:
|
1 jush set proxy.config.http.negative_caching_enabled 1 |
|
Thanks. So you mean the 404 is stale and ats goes back to the OS. And then OS return 200 to ats. That make sense, will test it in this weekend. |
yes |
|
Yes I see. In fact, it is not only negative cache issue but also the whole cache update cases I think . When someone want to update an object with response data (not header only cases), it always copy fragments table from old info. trafficserver/iocore/cache/CacheWrite.cc Lines 108 to 112 in 88b5a13
How about changing the L108 to like that the |
|
@taaotao007 Do you want to update your PR ? |
|
Thanks to your report. open an issue #5694 to trace it . Please feel free to reopen it. |
when set 404 response cached, first time got 404 response, then next request got 200 response,but fragment offset did not changed, this cause range request data error.