mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-19 16:57:40 +03:00
[kvutils] - Rename expire_at to prunable_from for clarity [KVL-1199] (#11960)
changelog_begin changelog_end
This commit is contained in:
parent
28e62820ef
commit
383e251e88
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user