Skip to content

Commit

Permalink
Merge branch 'vmware:master' into concord_client_request_cmf_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bandatarunkumar authored May 23, 2022
2 parents 4f32319 + 16b7558 commit f8314a6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
17 changes: 8 additions & 9 deletions bftengine/src/bftengine/ReplicaImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2097,8 +2097,7 @@ void ReplicaImp::onCommitCombinedSigSucceeded(SeqNum seqNumber,
(seqNumber > lastExecutedSeqNum + config_.getconcurrencyLevel() + activeExecutions_);

auto span = concordUtils::startChildSpanFromContext(
commitFull->spanContext<std::remove_pointer<decltype(commitFull)>::type>(),
"bft_handle_commit_combined_sig_succeeded_message");
commitFull->spanContext<std::remove_pointer<decltype(commitFull)>::type>(), "bft_execute_committed_reqs");
updateCommitMetrics(CommitPath::SLOW);
startExecution(seqNumber, span, askForMissingInfoAboutCommittedItems);
}
Expand Down Expand Up @@ -2145,8 +2144,7 @@ void ReplicaImp::onCommitVerifyCombinedSigResult(SeqNum seqNumber, ViewNum view,
LOG_INFO(CNSUS, "Request committed, proceeding to try to execute" << KVLOG(view));

auto span = concordUtils::startChildSpanFromContext(
commitFull->spanContext<std::remove_pointer<decltype(commitFull)>::type>(),
"bft_handle_commit_verify_combined_sig_result");
commitFull->spanContext<std::remove_pointer<decltype(commitFull)>::type>(), "bft_execute_committed_reqs");
bool askForMissingInfoAboutCommittedItems =
(seqNumber > lastExecutedSeqNum + config_.getconcurrencyLevel() + activeExecutions_);
updateCommitMetrics(CommitPath::SLOW);
Expand Down Expand Up @@ -2205,7 +2203,7 @@ void ReplicaImp::onFastPathCommitCombinedSigSucceeded(SeqNum seqNumber,
lastExecutedSeqNum + config_.getconcurrencyLevel() + activeExecutions_); // TODO(GG): check/improve this logic

auto span = concordUtils::startChildSpanFromContext(fcp->spanContext<std::remove_pointer<decltype(fcp)>::type>(),
"bft_handle_fast_path_commit_combined_sig_succeeded");
"bft_execute_committed_reqs");

updateCommitMetrics(cPath);

Expand Down Expand Up @@ -2270,7 +2268,7 @@ void ReplicaImp::onFastPathCommitVerifyCombinedSigResult(SeqNum seqNumber,
lastExecutedSeqNum + config_.getconcurrencyLevel() + activeExecutions_); // TODO(GG): check/improve this logic

auto span = concordUtils::startChildSpanFromContext(fcp->spanContext<std::remove_pointer<decltype(fcp)>::type>(),
"bft_handle_fast_path_commit_verify_combined_sig_result");
"bft_execute_committed_reqs");

updateCommitMetrics(cPath);

Expand Down Expand Up @@ -4970,14 +4968,14 @@ void ReplicaImp::executeSpecialRequests(PrePrepareMsg *ppMsg,
reqIdx++;
}

auto span_context = ppMsg->spanContext<std::remove_pointer<decltype(ppMsg)>::type>();
// TODO(GG): the following code is cumbersome. We can call to execute directly in the above loop
IRequestsHandler::ExecutionRequestsQueue singleRequest;
for (IRequestsHandler::ExecutionRequest &req : accumulatedRequests) {
ConcordAssert(singleRequest.empty());
singleRequest.push_back(req);
{
auto span = concordUtils::startChildSpanFromContext(span_context, "bft_client_special_request");
const concordUtils::SpanContext &span_context{""};
auto span = concordUtils::startChildSpanFromContext(span_context, "bft_client_request");
span.setTag("rid", config_.getreplicaId());
span.setTag("cid", req.cid);
span.setTag("seq_num", req.requestSequenceNum);
Expand Down Expand Up @@ -5039,12 +5037,12 @@ void ReplicaImp::executeRequests(PrePrepareMsg *ppMsg, Bitmap &requestSet, Times
setConflictDetectionBlockId(req, pAccumulatedRequests->back());
}
}
auto span_context = ppMsg->spanContext<std::remove_pointer<decltype(ppMsg)>::type>();
if (ReplicaConfig::instance().blockAccumulation) {
LOG_DEBUG(GL,
"Executing all the requests of preprepare message with cid: " << ppMsg->getCid() << " with accumulation");
{
// TimeRecorder scoped_timer1(*histograms_.executeWriteRequest);
const concordUtils::SpanContext &span_context{""};
auto span = concordUtils::startChildSpanFromContext(span_context, "bft_client_request");
span.setTag("rid", config_.getreplicaId());
span.setTag("cid", ppMsg->getCid());
Expand All @@ -5067,6 +5065,7 @@ void ReplicaImp::executeRequests(PrePrepareMsg *ppMsg, Bitmap &requestSet, Times
singleRequest.push_back(req);
{
// TimeRecorder scoped_timer1(*histograms_.executeWriteRequest);
const concordUtils::SpanContext &span_context{""};
auto span = concordUtils::startChildSpanFromContext(span_context, "bft_client_request");
span.setTag("rid", config_.getreplicaId());
span.setTag("cid", ppMsg->getCid());
Expand Down
24 changes: 18 additions & 6 deletions thin-replica-server/test/thin_replica_server_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,9 @@ TEST(thin_replica_server_test, SubscribeToPrivateEventGroupUpdatesWithGap) {
EXPECT_EQ(state_machine.numEventGroupsReceived(), total_event_groups);
}

TEST(thin_replica_server_test, SubscribeToPrivateEventGroupUpdatesWithGapTwoClients) {
// Disabled due to instability in order to unblock master for other fixes to improve its stability.
// TODO (Alex): Develop a propper fix and re-enable this test.
TEST(thin_replica_server_test, DISABLED_SubscribeToPrivateEventGroupUpdatesWithGapTwoClients) {
// Initialize storage and live update queue
FakeStorage storage(generateEventGroupMap(1, kLastEventGroupId, EventGroupType::PrivateEventGroupsOnly, kClientId1));
auto client2_egs = generateEventGroupMap(
Expand Down Expand Up @@ -1427,7 +1429,9 @@ TEST(thin_replica_server_test, SubscribeToPublicEventGroupUpdatesWithGap) {
EXPECT_EQ(state_machine.numEventGroupsReceived(), total_event_groups);
}

TEST(thin_replica_server_test, SubscribeToPublicEventGroupUpdatesWithGapTwoClients) {
// Disabled due to instability in order to unblock master for other fixes to improve its stability.
// TODO (Alex): Develop a propper fix and re-enable this test.
TEST(thin_replica_server_test, DISABLED_SubscribeToPublicEventGroupUpdatesWithGapTwoClients) {
// Initialize storage and live update queue with public event groups and private event groups for kClientId2
// Initialize storage and live update queue
FakeStorage storage(generateEventGroupMap(1, kLastEventGroupId, EventGroupType::PublicEventGroupsOnly));
Expand Down Expand Up @@ -1557,7 +1561,9 @@ TEST(thin_replica_server_test, SubscribeToPublicAndPrivateEventGroupUpdatesWithG
EXPECT_EQ(state_machine.numEventGroupsReceived(), total_event_groups);
}

TEST(thin_replica_server_test, SubscribeToPublicAndPrivateEventGroupUpdatesWithGapTwoClients) {
// Disabled due to instability in order to unblock master for other fixes to improve its stability.
// TODO (Alex): Develop a propper fix and re-enable this test.
TEST(thin_replica_server_test, DISABLED_SubscribeToPublicAndPrivateEventGroupUpdatesWithGapTwoClients) {
// Initialize storage and live update queue
FakeStorage storage(
generateEventGroupMap(1, kLastEventGroupId, EventGroupType::PublicAndPrivateEventGroups, kClientId1));
Expand Down Expand Up @@ -2245,7 +2251,9 @@ TEST(thin_replica_server_test, SubscribeToPrivateEventGroupUpdateHashesWithGap)
EXPECT_EQ(state_machine.numEventGroupsReceived(), total_event_groups);
}

TEST(thin_replica_server_test, SubscribeToPrivateEventGroupUpdateHashesWithGapTwoClients) {
// Disabled due to instability in order to unblock master for other fixes to improve its stability.
// TODO (Alex): Develop a propper fix and re-enable this test.
TEST(thin_replica_server_test, DISABLED_SubscribeToPrivateEventGroupUpdateHashesWithGapTwoClients) {
// Initialize storage and live update queue
FakeStorage storage(generateEventGroupMap(1, kLastEventGroupId, EventGroupType::PrivateEventGroupsOnly, kClientId1));
auto client2_egs = generateEventGroupMap(
Expand Down Expand Up @@ -2374,7 +2382,9 @@ TEST(thin_replica_server_test, SubscribeToPublicEventGroupUpdateHashesWithGap) {
EXPECT_EQ(state_machine.numEventGroupsReceived(), total_event_groups);
}

TEST(thin_replica_server_test, SubscribeToPublicEventGroupUpdateHashesWithGapTwoClients) {
// Disabled due to instability in order to unblock master for other fixes to improve its stability.
// TODO (Alex): Develop a propper fix and re-enable this test.
TEST(thin_replica_server_test, DISABLED_SubscribeToPublicEventGroupUpdateHashesWithGapTwoClients) {
// Initialize storage and live update queue
FakeStorage storage(generateEventGroupMap(1, kLastEventGroupId, EventGroupType::PublicEventGroupsOnly));
auto client2_egs = generateEventGroupMap(
Expand Down Expand Up @@ -2503,7 +2513,9 @@ TEST(thin_replica_server_test, SubscribeToPublicAndPrivateEventGroupUpdateHashes
EXPECT_EQ(state_machine.numEventGroupsReceived(), total_event_groups);
}

TEST(thin_replica_server_test, SubscribeToPublicAndPrivateEventGroupUpdateHashesWithGapTwoClients) {
// Disabled due to instability in order to unblock master for other fixes to improve its stability.
// TODO (Alex): Develop a propper fix and re-enable this test.
TEST(thin_replica_server_test, DISABLED_SubscribeToPublicAndPrivateEventGroupUpdateHashesWithGapTwoClients) {
// Initialize storage and live update queue
FakeStorage storage(
generateEventGroupMap(1, kLastEventGroupId, EventGroupType::PublicAndPrivateEventGroups, kClientId1));
Expand Down

0 comments on commit f8314a6

Please sign in to comment.