Skip to content

Conversation

OriolMunoz-da
Copy link
Contributor

Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
Comment on lines +609 to +616
Future.successful(
DestinationHistory.InsertResult(
backfilledUpdates = 0L,
backfilledEvents = 0L,
lastBackfilledRecordTime =
items.headOption.map(_.update.recordTime).getOrElse(CantonTimestamp.MinValue),
)
.transactionally,
"destinationHistory.insert",
)
} yield DestinationHistory.InsertResult(
backfilledUpdates = trees.size.toLong,
backfilledEvents =
trees.foldLeft(0L)((sum, tree) => sum + tree.getEventsById.size().toLong),
lastBackfilledRecordTime = CantonTimestamp.assertFromInstant(nonEmpty.last.getRecordTime),
)
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here be dragons, I don't understand why the previous was throwing an exception

@OriolMunoz-da OriolMunoz-da self-assigned this Sep 4, 2025
@OriolMunoz-da OriolMunoz-da marked this pull request as ready for review September 4, 2025 15:26
Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
Copy link
Contributor

@rautenrieth-da rautenrieth-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me how exactly you got an exception here? The method includes the assertion

assert(
  tree.getRecordTime.isAfter(CantonTimestamp.MinValue.toInstant),
  "insert() must not be called with import updates",
)

and looking at the call site (HistoryBackfilling), the method should really not be called with any items that have a record time of CantonTimestamp.MinValue.

@OriolMunoz-da
Copy link
Contributor Author

@rautenrieth-da see this PR targeting this one which removes the filter, and these failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants