fix reason serialization bug

This commit is contained in:
XiaoxiWang 2020-09-11 07:21:57 +00:00
parent 44db744ddc
commit 084c69b2ad
2 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ TagThrottleKey TagThrottleKey::fromKey(const KeyRef& key) {
TagThrottleValue TagThrottleValue::fromValue(const ValueRef& value) {
TagThrottleValue throttleValue;
BinaryReader reader(value, IncludeVersion());
BinaryReader reader(value, IncludeVersion(ProtocolVersion::withTagThrottleValueReason()));
reader >> throttleValue;
return throttleValue;
}
@ -228,7 +228,7 @@ namespace ThrottleApi {
}
TagThrottleValue throttle(tpsRate, expirationTime.present() ? expirationTime.get() : 0, initialDuration,
reason.present() ? reason.get() : TagThrottledReason::UNSET);
BinaryWriter wr(IncludeVersion(ProtocolVersion::withTagThrottleValue()));
BinaryWriter wr(IncludeVersion(ProtocolVersion::withTagThrottleValueReason()));
wr << throttle;
state Value value = wr.toValue();

View File

@ -812,7 +812,7 @@ ACTOR Future<Void> monitorThrottlingChanges(RatekeeperData *self) {
if(tagValue.expirationTime == 0 || tagValue.expirationTime > now() + tagValue.initialDuration) {
TEST(true); // Converting tag throttle duration to absolute time
tagValue.expirationTime = now() + tagValue.initialDuration;
BinaryWriter wr(IncludeVersion(ProtocolVersion::withTagThrottleValue()));
BinaryWriter wr(IncludeVersion(ProtocolVersion::withTagThrottleValueReason()));
wr << tagValue;
state Value value = wr.toValue();