-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable pruning in the sandbox-classic when the append-only schema is used [DPP-567] #10708
Changes from 4 commits
2158fee
1fa4ad8
77c5920
84f4c22
8c494e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,14 @@ private[sandbox] object SandboxIndexAndWriteService { | |
validatePartyAllocation = validatePartyAllocation, | ||
enableAppendOnlySchema = enableAppendOnlySchema, | ||
enableCompression = enableCompression, | ||
).flatMap(ledger => owner(MeteredLedger(ledger, metrics), participantId, timeProvider)) | ||
).flatMap(ledger => | ||
owner( | ||
ledger = MeteredLedger(ledger, metrics), | ||
participantId = participantId, | ||
timeProvider = timeProvider, | ||
enablePruning = enableAppendOnlySchema, | ||
) | ||
) | ||
|
||
def inMemory( | ||
name: LedgerName, | ||
|
@@ -117,19 +124,25 @@ private[sandbox] object SandboxIndexAndWriteService { | |
templateStore, | ||
ledgerEntries, | ||
) | ||
owner(MeteredLedger(ledger, metrics), participantId, timeProvider) | ||
owner( | ||
ledger = MeteredLedger(ledger, metrics), | ||
participantId = participantId, | ||
timeProvider = timeProvider, | ||
enablePruning = false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't we enable pruning for in-memory ledger? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you can document it in the PR header why this one is left out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a corer case that we should not spend any time debating at this point. It would have to go through another story if we wanted that support. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fine by me. Just observed that there is no mention in the ticket or the PR regarding it. |
||
) | ||
} | ||
|
||
private def owner( | ||
ledger: Ledger, | ||
participantId: Ref.ParticipantId, | ||
timeProvider: TimeProvider, | ||
enablePruning: Boolean, | ||
)(implicit | ||
mat: Materializer, | ||
loggingContext: LoggingContext, | ||
): ResourceOwner[IndexAndWriteService] = { | ||
val indexSvc = new LedgerBackedIndexService(ledger, participantId) | ||
val writeSvc = new LedgerBackedWriteService(ledger, timeProvider) | ||
val writeSvc = new LedgerBackedWriteService(ledger, timeProvider, enablePruning) | ||
|
||
for { | ||
_ <- new HeartbeatScheduler( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not enabling pruning, just pretending to prune, no?
how is the conformance tests pass then?
am I missing something? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly the
ApiParticipantPruningService
performs pruning in two steps:For the
sandbox-classic
they are the same thing, so returningParticipantPruned
for the step 1. enables the step two.@mziolekda can you confirm that this is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yupp, makes sense, a comment would be nice to clarify this behavior in the write service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pruneAllDivulgedContracts
is not meant to be supported forsandbox-classic
because the backfiling lookup queries can start failing if used. Please returnUNIMPLEMENTED
if that flag is set. And please add a mention to the restriction in this method's doc/comments (e.g.Pruning of all divulged contracts is not supported on sandbox-classic
)