merged from gramsrv upstream
This commit is contained in:
parent
79c64ee916
commit
21a0856587
651 changed files with 54774 additions and 4590 deletions
|
|
@ -209,6 +209,15 @@ WHERE channel_id = $1`, channelID, cursor, checkpoint.LatestEventDate, checkpoin
|
|||
if tag.RowsAffected() != 1 {
|
||||
return fmt.Errorf("advance channel update retained floor: checkpoint row disappeared for channel %d", channelID)
|
||||
}
|
||||
// Retention changes whether an old cursor receives a normal page or
|
||||
// channelDifferenceTooLong without changing channel.pts. Publish a
|
||||
// dedicated generation so every instance drops immutable pages built
|
||||
// against the previous floor.
|
||||
if _, err := tx.Exec(ctx, `SELECT telesrv_bump_read_model_version(
|
||||
'channel_difference_base', 0, 'channel', $1
|
||||
)`, channelID); err != nil {
|
||||
return fmt.Errorf("bump channel difference retention read model: %w", err)
|
||||
}
|
||||
checkpoint.RetainedThroughPts = cursor
|
||||
result = domain.ChannelUpdateRetentionResult{Checkpoint: checkpoint, Deleted: len(ptsToDelete)}
|
||||
return nil
|
||||
|
|
@ -216,6 +225,9 @@ WHERE channel_id = $1`, channelID, cursor, checkpoint.LatestEventDate, checkpoin
|
|||
if err != nil {
|
||||
return domain.ChannelUpdateRetentionResult{}, err
|
||||
}
|
||||
if result.Deleted > 0 && s.differenceCache != nil {
|
||||
s.differenceCache.deleteChannel(channelID)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue