Reduce high_density_shard_create_scan shard+thread combinations. Log Raft write request demangled names

This commit is contained in:
Tyler Neely 2022-11-03 12:38:12 +00:00
parent b83fb287ad
commit 9235515dab
2 changed files with 17 additions and 4 deletions

View File

@ -22,6 +22,8 @@
#include <unordered_map>
#include <vector>
#include <boost/core/demangle.hpp>
#include "io/message_conversion.hpp"
#include "io/simulator/simulator.hpp"
#include "io/transport.hpp"
@ -109,6 +111,16 @@ utils::TypeInfoRef TypeInfoFor(const WriteResponse<WriteReturn> & /* write_respo
return typeid(WriteReturn);
}
template <class WriteOperation>
utils::TypeInfoRef TypeInfoFor(const WriteRequest<WriteOperation> & /* write_request */) {
return typeid(WriteOperation);
}
template <class... WriteOperations>
utils::TypeInfoRef TypeInfoFor(const WriteRequest<std::variant<WriteOperations...>> &write_request) {
return TypeInfoForVariant(write_request.operation);
}
/// AppendRequest is a raft-level message that the Leader
/// periodically broadcasts to all Follower peers. This
/// serves three main roles:
@ -918,7 +930,9 @@ class Raft {
// only leaders actually handle replication requests from clients
std::optional<Role> Handle(Leader &leader, WriteRequest<WriteOperation> &&req, RequestId request_id,
Address from_address) {
Log("handling WriteRequest");
auto type_info = TypeInfoFor(req);
std::string demangled_name = boost::core::demangle(type_info.get().name());
Log("handling WriteRequest<" + demangled_name + ">");
// we are the leader. add item to log and send Append to peers
MG_ASSERT(state_.term >= LastLogTerm());

View File

@ -283,9 +283,8 @@ void RunWorkload(int shards, int replication_factor, int create_ops, int scan_op
}
TEST(MachineManager, ManyShards) {
auto shards_attempts = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32};
auto shard_worker_thread_attempts = {1, 2, 3, 4, 6, 8};
auto shards_attempts = {1, 2, 4, 8};
auto shard_worker_thread_attempts = {1, 2, 4, 8};
auto replication_factor = 1;
auto create_ops = 1024;
auto scan_ops = 1;