diff --git a/fdbclient/ClientLogEvents.h b/fdbclient/ClientLogEvents.h index a155133b76..614c8cf7c7 100644 --- a/fdbclient/ClientLogEvents.h +++ b/fdbclient/ClientLogEvents.h @@ -92,7 +92,7 @@ namespace FdbClientLogEvents { default: ASSERT(false); } - } + } EventGetVersion_V2() { } template Ar& serialize(Ar &ar) { @@ -115,17 +115,22 @@ namespace FdbClientLogEvents { // Version V3 of EventGetVersion starting at 6.3 struct EventGetVersion_V3 : public Event { - EventGetVersion_V3(double ts, double lat, uint32_t type, Version version) : Event(GET_VERSION_LATENCY, ts), latency(lat), readVersion(version) { - if(type == GetReadVersionRequest::PRIORITY_DEFAULT) { - priorityType = PRIORITY_DEFAULT; - } else if (type == GetReadVersionRequest::PRIORITY_BATCH) { - priorityType = PRIORITY_BATCH; - } else if (type == GetReadVersionRequest::PRIORITY_SYSTEM_IMMEDIATE){ - priorityType = PRIORITY_IMMEDIATE; - } else { - ASSERT(0); + EventGetVersion_V3(double ts, double lat, TransactionPriority priority, Version version) : Event(GET_VERSION_LATENCY, ts), latency(lat), readVersion(version) { + switch(priority) { + // Unfortunately, the enum serialized here disagrees with the enum used elsewhere for the values used by each priority + case TransactionPriority::IMMEDIATE: + priorityType = PRIORITY_IMMEDIATE; + break; + case TransactionPriority::DEFAULT: + priorityType = PRIORITY_DEFAULT; + break; + case TransactionPriority::BATCH: + priorityType = PRIORITY_BATCH; + break; + default: + ASSERT(false); } - } + } EventGetVersion_V3() { } template Ar& serialize(Ar &ar) {