@@ -146,6 +146,7 @@ var constSubKeyDict = []struct {
146
146
{"/clusterVersion" , localStoreClusterVersionSuffix },
147
147
{"/nodeTombstone" , localStoreNodeTombstoneSuffix },
148
148
{"/cachedSettings" , localStoreCachedSettingsSuffix },
149
+ {"/wag" , localStoreWAGNodeSuffix },
149
150
{"/lossOfQuorumRecovery/applied" , localStoreUnsafeReplicaRecoverySuffix },
150
151
{"/lossOfQuorumRecovery/status" , localStoreLossOfQuorumRecoveryStatusSuffix },
151
152
{"/lossOfQuorumRecovery/cleanup" , localStoreLossOfQuorumRecoveryCleanupActionsSuffix },
@@ -167,10 +168,19 @@ func cachedSettingsKeyPrint(buf *redact.StringBuilder, key roachpb.Key) {
167
168
buf .Print (settingKey .String ())
168
169
}
169
170
171
+ func wagNodeKeyPrint (buf * redact.StringBuilder , key roachpb.Key ) {
172
+ index , err := DecodeWAGNodeKey (key )
173
+ if err != nil {
174
+ buf .Printf ("<invalid: %s>" , err )
175
+ }
176
+ buf .Printf ("%d" , index )
177
+ }
178
+
170
179
func localStoreKeyPrint (buf * redact.StringBuilder , _ []encoding.Direction , key roachpb.Key ) {
171
180
for _ , v := range constSubKeyDict {
172
181
if bytes .HasPrefix (key , v .key ) {
173
182
buf .Print (v .name )
183
+ // TODO(pav-kv): make this switch more efficient with a lookup.
174
184
if v .key .Equal (localStoreNodeTombstoneSuffix ) {
175
185
buf .SafeRune ('/' )
176
186
nodeTombstoneKeyPrint (
@@ -186,6 +196,9 @@ func localStoreKeyPrint(buf *redact.StringBuilder, _ []encoding.Direction, key r
186
196
lossOfQuorumRecoveryEntryKeyPrint (
187
197
buf , append (roachpb .Key (nil ), append (LocalStorePrefix , key ... )... ),
188
198
)
199
+ } else if v .key .Equal (localStoreWAGNodeSuffix ) {
200
+ buf .SafeRune ('/' )
201
+ wagNodeKeyPrint (buf , append (append (roachpb .Key (nil ), LocalStorePrefix ... ), key ... ))
189
202
}
190
203
return
191
204
}
0 commit comments