Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions be/src/runtime/load_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,19 @@ int LoadStream::on_received_messages(StreamId id, butil::IOBuf* const messages[]
void LoadStream::_dispatch(StreamId id, const PStreamHeader& hdr, butil::IOBuf* data) {
VLOG_DEBUG << PStreamHeader_Opcode_Name(hdr.opcode()) << " from " << hdr.src_id()
<< " with tablet " << hdr.tablet_id();
DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_loadid", {
PUniqueId& load_id = const_cast<PUniqueId&>(hdr.load_id());
load_id.set_hi(UNKNOWN_ID_FOR_TEST);
load_id.set_lo(UNKNOWN_ID_FOR_TEST);
});
DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_srcid", {
PStreamHeader& t_hdr = const_cast<PStreamHeader&>(hdr);
t_hdr.set_src_id(UNKNOWN_ID_FOR_TEST);
});
// CLOSE_LOAD message should not be fault injected,
// otherwise the message will be ignored and causing close wait timeout
if (hdr.opcode() != PStreamHeader::CLOSE_LOAD) {
Copy link
Contributor

Choose a reason for hiding this comment

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

        DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_loadid", {
            if (hdr.opcode() != PStreamHeader::CLOSE_LOAD) {
                PUniqueId& load_id = const_cast<PUniqueId&>(hdr.load_id());
                load_id.set_hi(UNKNOWN_ID_FOR_TEST);
                load_id.set_lo(UNKNOWN_ID_FOR_TEST);
            }
        });

Placing the if condition into the debug point may be better.

DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_loadid", {
PUniqueId& load_id = const_cast<PUniqueId&>(hdr.load_id());
load_id.set_hi(UNKNOWN_ID_FOR_TEST);
load_id.set_lo(UNKNOWN_ID_FOR_TEST);
});
DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_srcid", {
PStreamHeader& t_hdr = const_cast<PStreamHeader&>(hdr);
t_hdr.set_src_id(UNKNOWN_ID_FOR_TEST);
});
}
if (UniqueId(hdr.load_id()) != UniqueId(_load_id)) {
Status st = Status::Error<ErrorCode::INVALID_ARGUMENT>(
"invalid load id {}, expected {}", print_id(hdr.load_id()), print_id(_load_id));
Expand Down