[kvutils] - Rename expire_at to prunable_from for clarity [KVL-1199] (#11960)

changelog_begin
changelog_end
This commit is contained in:
nicu-da 2021-12-06 00:02:26 -08:00 committed by GitHub
parent 28e62820ef
commit 383e251e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -119,7 +119,7 @@ USAGE
# The files are always split for versions > 1.17, and there is no way of opening a PR against a target <= 1.17 which includes this check
BUF_CONFIG_UPDATED=true
BUF_GIT_TARGET_TO_CHECK=".git#branch=origin/${TARGET}"
# The target check can be skipped by including the following trailer `Breaks-Proto: true` into the commit message
# The target check can be skipped by including the following trailer `Breaks-Protobuf: true` into the commit message
if is_check_skipped; then
echo "Skipping check for protobuf compatibility"
else

View File

@ -62,7 +62,7 @@ message DamlCommandDedupValue {
PreExecutionDeduplicationBounds record_time_bounds = 4;
}
string submission_id = 5;
google.protobuf.Timestamp expire_at = 6;
google.protobuf.Timestamp prunable_from = 6;
}
message PreExecutionDeduplicationBounds {

View File

@ -200,14 +200,14 @@ private[transaction] object CommandDeduplication {
val (_, config) = getCurrentConfiguration(defaultConfig, commitContext)
// build the maximum interval for which we might use the deduplication entry
// we account for both time skews even if it means that the expiry time would be slightly longer than required
val expireInterval =
val pruningInterval =
config.maxDeduplicationTime.plus(config.timeModel.maxSkew).plus(config.timeModel.minSkew)
commitContext.recordTime match {
case Some(recordTime) =>
val expireAt = recordTime.add(expireInterval)
val prunableFrom = recordTime.add(pruningInterval)
commandDedupBuilder
.setRecordTime(Conversions.buildTimestamp(recordTime))
.setExpireAt(Conversions.buildTimestamp(expireAt))
.setPrunableFrom(Conversions.buildTimestamp(prunableFrom))
case None =>
val maxRecordTime = commitContext.maximumRecordTime.getOrElse(
throw Err.InternalError("Maximum record time is not set for pre-execution")
@ -215,14 +215,14 @@ private[transaction] object CommandDeduplication {
val minRecordTime = commitContext.minimumRecordTime.getOrElse(
throw Err.InternalError("Minimum record time is not set for pre-execution")
)
val expireAt = maxRecordTime.add(expireInterval)
val prunableFrom = maxRecordTime.add(pruningInterval)
commandDedupBuilder
.setRecordTimeBounds(
PreExecutionDeduplicationBounds.newBuilder
.setMaxRecordTime(Conversions.buildTimestamp(maxRecordTime))
.setMinRecordTime(Conversions.buildTimestamp(minRecordTime))
)
.setExpireAt(Conversions.buildTimestamp(expireAt))
.setPrunableFrom(Conversions.buildTimestamp(prunableFrom))
}
// Set a deduplication entry.

View File

@ -280,7 +280,7 @@ class CommandDeduplicationSpec
.build()
}
"set expire time based on max record time" in {
"set pruning time based on max record time" in {
val (context, transactionEntrySummary) =
buildContextAndTransaction(
submissionTime,
@ -294,7 +294,7 @@ class CommandDeduplicationSpec
parseTimestamp(
deduplicateValueStoredInContext(context, transactionEntrySummary)
.map(
_.getExpireAt
_.getPrunableFrom
)
.value
) shouldBe maximumRecordTime
@ -341,7 +341,7 @@ class CommandDeduplicationSpec
) shouldBe recordTime
}
"set expire time based on record time" in {
"set pruning time based on record time" in {
val recordTime = timestamp
val (context, transactionEntrySummary) =
buildContextAndTransaction(
@ -353,7 +353,7 @@ class CommandDeduplicationSpec
parseTimestamp(
deduplicateValueStoredInContext(context, transactionEntrySummary)
.map(
_.getExpireAt
_.getPrunableFrom
)
.value
) shouldBe recordTime