MCPcopy
hub / github.com/grafana/tempo / allowCompaction

Method allowCompaction

modules/blockbuilder/partition_writer.go:111–134  ·  view source on GitHub ↗
(ctx context.Context, w tempodb.Writer)

Source from the content-addressed store, hash-verified

109}
110
111func (p *writer) allowCompaction(ctx context.Context, w tempodb.Writer) {
112 ctx, span := tracer.Start(
113 ctx, "writer.allowCompaction",
114 trace.WithAttributes(
115 attribute.Int("partition", int(p.partition)),
116 attribute.String("section_start_time", p.startTime.String()),
117 ),
118 )
119 defer span.End()
120
121 wg := sync.WaitGroup{}
122 wg.Add(len(p.m))
123 for _, i := range p.m {
124 go func() {
125 defer wg.Done()
126 level.Info(p.logger).Log("msg", "allowing compaction", "tenant", i.tenantID)
127 err := i.AllowCompaction(ctx, w)
128 if err != nil {
129 level.Error(p.logger).Log("msg", "failed to allow compaction, the block will remain uncompacted", "tenant", i.tenantID, "err", err)
130 }
131 }()
132 }
133 wg.Wait()
134}
135
136func (p *writer) instanceForTenant(tenant string) (*tenantStore, error) {
137 p.mtx.Lock()

Callers 1

consumePartitionMethod · 0.80

Calls 9

IntMethod · 0.80
AllowCompactionMethod · 0.80
StartMethod · 0.65
AddMethod · 0.65
DoneMethod · 0.65
LogMethod · 0.65
ErrorMethod · 0.65
WaitMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected