Skip to content

Commit

Permalink
Remove some traces
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketkedia committed Dec 13, 2024
1 parent 0f03b9c commit be1360e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions go/pkg/log/purging/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ func PerformPurgingLoop(ctx context.Context, lg *repository.LogRepository) {
log.Error("failed to purge records", zap.Error(err))
continue
}
log.Info("purged records")
case <-gcTicker.C:
// TODO: Add a RPC to manually trigger garbage collection
if err := lg.GarbageCollection(ctx); err != nil {
log.Error("failed to garbage collect", zap.Error(err))
continue
}
log.Info("garbage collected")
}
}
}
5 changes: 0 additions & 5 deletions go/pkg/log/repository/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ func (r *LogRepository) UpdateCollectionCompactionOffsetPosition(ctx context.Con
}

func (r *LogRepository) PurgeRecords(ctx context.Context) (err error) {
trace_log.Info("Purging records from record_log table")
err = r.queries.PurgeRecords(ctx)
return
}
Expand All @@ -175,8 +174,6 @@ func (r *LogRepository) GarbageCollection(ctx context.Context) error {
if err != nil {
trace_log.Error("Error in getting collections to compact", zap.Error(err))
return err
} else {
trace_log.Info("GC Got collections to compact", zap.Int("collectionCount", len(collectionToCompact)))
}
if collectionToCompact == nil {
return nil
Expand Down Expand Up @@ -213,13 +210,11 @@ func (r *LogRepository) GarbageCollection(ctx context.Context) error {
err = tx.Commit(ctx)
}
}()
trace_log.Info("Starting garbage collection", zap.Strings("collections", collectionsToGC))
err = queriesWithTx.DeleteRecords(ctx, collectionsToGC)
if err != nil {
trace_log.Error("Error in garbage collection", zap.Error(err))
return err
}
trace_log.Info("Delete collections", zap.Strings("collections", collectionsToGC))
err = queriesWithTx.DeleteCollection(ctx, collectionsToGC)
if err != nil {
trace_log.Error("Error in deleting collection", zap.Error(err))
Expand Down

0 comments on commit be1360e

Please sign in to comment.