mirror of
https://github.com/matrix-org/dendrite
synced 2024-10-31 21:19:04 +01:00
Track partition offsets and only log unsafe for non-selects
This commit is contained in:
parent
bfecc8e0e9
commit
7bf2a27319
2 changed files with 15 additions and 2 deletions
|
@ -53,7 +53,7 @@ func (in *traceInterceptor) StmtQueryContext(ctx context.Context, stmt driver.St
|
|||
safe = w.Safe()
|
||||
}
|
||||
}
|
||||
if safe != "" {
|
||||
if safe != "" && !strings.HasPrefix(query, "SELECT ") {
|
||||
logrus.Infof("unsafe: %s -- %s", safe, query)
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ func (in *traceInterceptor) StmtExecContext(ctx context.Context, stmt driver.Stm
|
|||
safe = w.Safe()
|
||||
}
|
||||
}
|
||||
if safe != "" {
|
||||
if safe != "" && !strings.HasPrefix(query, "SELECT ") {
|
||||
logrus.Infof("unsafe: %s -- %s", safe, query)
|
||||
}
|
||||
|
||||
|
|
|
@ -258,3 +258,16 @@ func (d *SyncServerDatasource) PutFilter(ctx context.Context, localpart string,
|
|||
func (d *SyncServerDatasource) RedactEvent(ctx context.Context, redactedEventID string, redactedBecause *gomatrixserverlib.HeaderedEvent) error {
|
||||
return d.Database.RedactEvent(d.dbctx, redactedEventID, redactedBecause)
|
||||
}
|
||||
|
||||
func (d *SyncServerDatasource) PartitionOffsets(
|
||||
ctx context.Context, topic string,
|
||||
) ([]sqlutil.PartitionOffset, error) {
|
||||
return d.PartitionOffsetStatements.PartitionOffsets(d.dbctx, topic)
|
||||
}
|
||||
|
||||
// SetPartitionOffset implements PartitionStorer
|
||||
func (d *SyncServerDatasource) SetPartitionOffset(
|
||||
ctx context.Context, topic string, partition int32, offset int64,
|
||||
) error {
|
||||
return d.PartitionOffsetStatements.SetPartitionOffset(d.dbctx, topic, partition, offset)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue