Skip to content

Commit c97b2e3

Browse files
committed
asim: pass queue names for logging
This commit passes the name of the queue making changes to pushReplicateChange to improve logging. Epic: none Release note: none
1 parent 9d7f785 commit c97b2e3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/kv/kvserver/asim/queue/lease_queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func (lq *leaseQueue) Tick(ctx context.Context, tick time.Time, s state.State) {
165165
}
166166

167167
lq.next, lq.lastSyncChangeID = pushReplicateChange(
168-
ctx, change, repl, tick, lq.settings.ReplicaChangeDelayFn(), lq.baseQueue.stateChanger, lq.as)
168+
ctx, change, repl, tick, lq.settings.ReplicaChangeDelayFn(), lq.baseQueue.stateChanger, lq.as, "lease queue")
169169
}
170170

171171
lq.lastTick = tick

pkg/kv/kvserver/asim/queue/replicate_queue.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func (rq *replicateQueue) Tick(ctx context.Context, tick time.Time, s state.Stat
159159
}
160160

161161
rq.next, rq.lastSyncChangeID = pushReplicateChange(
162-
ctx, change, repl, tick, rq.settings.ReplicaChangeDelayFn(), rq.baseQueue.stateChanger, rq.as)
162+
ctx, change, repl, tick, rq.settings.ReplicaChangeDelayFn(), rq.baseQueue.stateChanger, rq.as, "replicate queue")
163163
}
164164

165165
rq.lastTick = tick
@@ -173,6 +173,7 @@ func pushReplicateChange(
173173
delayFn func(int64, bool) time.Duration,
174174
stateChanger state.Changer,
175175
as *mmaprototypehelpers.AllocatorSync,
176+
queueName string,
176177
) (time.Time, mmaprototypehelpers.SyncChangeID) {
177178
var stateChange state.Change
178179
var changeID mmaprototypehelpers.SyncChangeID
@@ -212,6 +213,7 @@ func pushReplicateChange(
212213
repl.StoreID(), /* leaseholder */
213214
)
214215
}
216+
log.VEventf(ctx, 1, "pushing state change for range=%s, details=%s changeIDs=%v coming from %s", repl.rng, op.Details, changeID, queueName)
215217
stateChange = &state.ReplicaChange{
216218
RangeID: state.RangeID(change.Replica.GetRangeID()),
217219
Changes: op.Chgs,

0 commit comments

Comments
 (0)