Skip to content

Commit e8aeb7d

Browse files
authored
Increment watch version only on actual modifications (#1434)
* fix * fixes * format * update version * fix * Bump version to 1.0.89
1 parent aaad6ae commit e8aeb7d

File tree

3 files changed

+78
-64
lines changed

3 files changed

+78
-64
lines changed

Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<!-- VersionPrefix property for builds and packages -->
33
<PropertyGroup>
4-
<VersionPrefix>1.0.87</VersionPrefix>
4+
<VersionPrefix>1.0.89</VersionPrefix>
55
</PropertyGroup>
66
</Project>

libs/server/Storage/Functions/MainStore/PrivateMethods.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void CopyRespToWithInput(ref RawStringInput input, ref SpanByte value, ref SpanB
274274
}
275275
}
276276

277-
bool EvaluateExpireInPlace(ExpireOption optionType, bool expiryExists, long newExpiry, ref SpanByte value, ref SpanByteAndMemory output)
277+
IPUResult EvaluateExpireInPlace(ExpireOption optionType, bool expiryExists, long newExpiry, ref SpanByte value, ref SpanByteAndMemory output)
278278
{
279279
ObjectOutputHeader* o = (ObjectOutputHeader*)output.SpanByte.ToPointer();
280280
if (expiryExists)
@@ -291,26 +291,26 @@ bool EvaluateExpireInPlace(ExpireOption optionType, bool expiryExists, long newE
291291
break;
292292
case ExpireOption.GT:
293293
case ExpireOption.XXGT:
294-
var replace = newExpiry < value.ExtraMetadata;
295-
value.ExtraMetadata = replace ? value.ExtraMetadata : newExpiry;
294+
var replace = newExpiry > value.ExtraMetadata;
295+
if (replace) value.ExtraMetadata = newExpiry;
296296
if (replace)
297-
o->result1 = 0;
298-
else
299297
o->result1 = 1;
298+
else
299+
o->result1 = 0;
300300
break;
301301
case ExpireOption.LT:
302302
case ExpireOption.XXLT:
303-
replace = newExpiry > value.ExtraMetadata;
304-
value.ExtraMetadata = replace ? value.ExtraMetadata : newExpiry;
303+
replace = newExpiry < value.ExtraMetadata;
304+
if (replace) value.ExtraMetadata = newExpiry;
305305
if (replace)
306-
o->result1 = 0;
307-
else
308306
o->result1 = 1;
307+
else
308+
o->result1 = 0;
309309
break;
310310
default:
311311
throw new GarnetException($"EvaluateExpireInPlace exception expiryExists:{expiryExists}, optionType{optionType}");
312312
}
313-
return true;
313+
return o->result1 == 1 ? IPUResult.Succeeded : IPUResult.NotUpdated;
314314
}
315315
else
316316
{
@@ -319,13 +319,13 @@ bool EvaluateExpireInPlace(ExpireOption optionType, bool expiryExists, long newE
319319
case ExpireOption.NX:
320320
case ExpireOption.None:
321321
case ExpireOption.LT: // If expiry doesn't exist, LT should treat the current expiration as infinite
322-
return false;
322+
return IPUResult.Failed;
323323
case ExpireOption.XX:
324324
case ExpireOption.GT:
325325
case ExpireOption.XXGT:
326326
case ExpireOption.XXLT:
327327
o->result1 = 0;
328-
return true;
328+
return IPUResult.NotUpdated;
329329
default:
330330
throw new GarnetException($"EvaluateExpireInPlace exception expiryExists:{expiryExists}, optionType{optionType}");
331331
}

0 commit comments

Comments
 (0)