@@ -292,7 +292,7 @@ func (s *SettingsWatcher) maybeSet(ctx context.Context, name string, sv settings
292292 }
293293 } else {
294294 if ! hasOverride {
295- s .setLocked (ctx , name , sv .val )
295+ s .setLocked (ctx , name , sv .val , settings . OriginExplicitlySet )
296296 }
297297 }
298298}
@@ -309,7 +309,9 @@ type settingsValue struct {
309309const versionSettingKey = "version"
310310
311311// set the current value of a setting.
312- func (s * SettingsWatcher ) setLocked (ctx context.Context , key string , val settings.EncodedValue ) {
312+ func (s * SettingsWatcher ) setLocked (
313+ ctx context.Context , key string , val settings.EncodedValue , origin settings.ValueOrigin ,
314+ ) {
313315 // Both the system tenant and secondary tenants no longer use this code
314316 // path to propagate cluster version changes (they rely on
315317 // BumpClusterVersion instead). The secondary tenants however, still rely
@@ -335,6 +337,7 @@ func (s *SettingsWatcher) setLocked(ctx context.Context, key string, val setting
335337 if err := s .mu .updater .Set (ctx , key , val ); err != nil {
336338 log .Warningf (ctx , "failed to set setting %s to %s: %v" , redact .Safe (key ), val .Value , err )
337339 }
340+ s .mu .updater .SetValueOrigin (ctx , key , origin )
338341}
339342
340343// setDefaultLocked sets a setting to its default value.
@@ -348,7 +351,7 @@ func (s *SettingsWatcher) setDefaultLocked(ctx context.Context, key string) {
348351 Value : setting .EncodedDefault (),
349352 Type : setting .Typ (),
350353 }
351- s .setLocked (ctx , key , val )
354+ s .setLocked (ctx , key , val , settings . OriginDefault )
352355}
353356
354357// updateOverrides updates the overrides map and updates any settings
@@ -384,7 +387,7 @@ func (s *SettingsWatcher) updateOverrides(ctx context.Context) {
384387 }
385388 // A new override was added or an existing override has changed.
386389 s .mu .overrides [key ] = val
387- s .setLocked (ctx , key , val )
390+ s .setLocked (ctx , key , val , settings . OriginExternallySet )
388391 }
389392
390393 // Clean up any overrides that were removed.
@@ -395,7 +398,7 @@ func (s *SettingsWatcher) updateOverrides(ctx context.Context) {
395398 // Reset the setting to the value in the settings table (or the default
396399 // value).
397400 if sv , ok := s .mu .values [key ]; ok && ! sv .tombstone {
398- s .setLocked (ctx , key , sv .val )
401+ s .setLocked (ctx , key , sv .val , settings . OriginExplicitlySet )
399402 } else {
400403 s .setDefaultLocked (ctx , key )
401404 }
0 commit comments