Skip to content

reduce log level of "prefix cached servers" to TRACE #842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/epp/scheduling/plugins/prefix/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func New(config Config) *Plugin {
return m
}

// Name returns the name of the plugin.
func (m *Plugin) Name() string {
return "prefix-cache"
}
Expand All @@ -131,7 +132,7 @@ func (m *Plugin) PreSchedule(ctx *types.SchedulingContext) {
}

ctx.CycleState.Write(types.StateKey(m.Name()), state)
ctx.Logger.V(logutil.DEBUG).Info(fmt.Sprintf("PreSchedule, cached servers: %+v", state.PrefixCacheServers), "hashes", state.PrefixHashes)
ctx.Logger.V(logutil.TRACE).Info(fmt.Sprintf("PreSchedule, cached servers: %+v", state.PrefixCacheServers), "hashes", state.PrefixHashes)
}

// If a request was routed to a server, record it in the cache:
Expand All @@ -148,6 +149,7 @@ func (m *Plugin) PostSchedule(ctx *types.SchedulingContext, res *types.Result) {
metrics.RecordPrefixCacheMatch(matchLen*m.HashBlockSize, total*m.HashBlockSize)
}

// Score returns the scoring result for the given list of pods based on context.
func (m *Plugin) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types.Pod]float64 {
scores := make(map[types.Pod]float64, len(pods))

Expand Down Expand Up @@ -184,7 +186,7 @@ func (m *Plugin) matchLongestPrefix(ctx *types.SchedulingContext, hashes []Block
hash := hashes[i]
cachedServers := m.indexer.Get(hash)
if len(cachedServers) > 0 {
ctx.Logger.V(logutil.DEBUG).Info("Found cached servers", "cachedServers", cachedServers, "total # blocks", len(hashes), "longest prefix", i)
ctx.Logger.V(logutil.TRACE).Info("Found cached servers", "cachedServers", cachedServers, "total # blocks", len(hashes), "longest prefix", i)
for server := range cachedServers {
// Update servers with their longest prefix match.
// If we already found this server with longer prefix match, don't update it.
Expand Down