masaori335 commented on code in PR #13847:
URL: https://github.com/apache/trafficserver/pull/13847#discussion_r4321595555
##########
src/iocore/cache/StripeSM.cc:
##########
@@ -758,8 +758,10 @@ StripeSM::aggWriteDone(int event, Event *e)
dir_clear(&del_dir);
for (int done = 0; done < this->_write_buffer.get_buffer_pos();) {
Doc *doc = reinterpret_cast<Doc *>(this->_write_buffer.get_buffer() +
done);
- dir_set_offset(&del_dir, directory.header->write_pos + done);
+ dir_set_offset(&del_dir,
this->offset_to_vol_offset(directory.header->write_pos + done));
+ // A head's entry is under first_key rather than the doc's key, and the
doc doesn't say which it is, so try both.
this->directory.remove(&doc->key, this, &del_dir);
+ this->directory.remove(&doc->first_key, this, &del_dir);
Review Comment:
This case does happen. A non-HTTP open_write sets first_key = key
(Cache.cc:524). But the first remove() has already deleted the entry, so the
second one finds nothing. It runs only when a disk write fails, and there's
only ever one entry at a given offset. A guard would add a branch and change
nothing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]