-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
service/databaseItems related to the xmtpd databaseItems related to the xmtpd database
Description
Currently inserting a gateway envelope can force a partition creation:
func InsertGatewayEnvelopeWithChecksStandalone(
ctx context.Context,
q *queries.Queries,
row queries.InsertGatewayEnvelopeParams,
) (queries.InsertGatewayEnvelopeRow, error) {
inserted, err := q.InsertGatewayEnvelope(ctx, row)
if err == nil {
return inserted, nil
}
if !strings.Contains(err.Error(), "no partition of relation") {
return queries.InsertGatewayEnvelopeRow{}, err
}
err = q.EnsureGatewayParts(ctx, queries.EnsureGatewayPartsParams{
OriginatorNodeID: row.OriginatorNodeID,
OriginatorSequenceID: row.OriginatorSequenceID,
BandWidth: GatewayEnvelopeBandWidth,
})
if err != nil {
return queries.InsertGatewayEnvelopeRow{}, err
}
// retry insert
return q.InsertGatewayEnvelope(ctx, row)
}
Even if rare, this could be avoided by using a background job that ensure partitions exists ahead of time.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
service/databaseItems related to the xmtpd databaseItems related to the xmtpd database
Type
Projects
Status
In Review