Skip to content

Commit

Permalink
docs, release notes
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Mason <[email protected]>
  • Loading branch information
Andrew Mason committed Mar 27, 2023
1 parent edae169 commit 38c662f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions changelog/17.0/17.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **[Major Changes](#major-changes)**
- **[Breaking Changes](#breaking-changes)**
- [Dedicated stats for VTGate Prepare operations](#dedicated-vtgate-prepare-stats)
- [Keyspace name validation in TopoServer](#keyspace-name-validation)
- **[New command line flags and behavior](#new-flag)**
- [Builtin backup: read buffering flags](#builtin-backup-read-buffering-flags)
- **[New stats](#new-stats)**
Expand Down Expand Up @@ -49,6 +50,16 @@ Here is a (condensed) example of stats output:
}
```


#### <a id="keyspace-name-validation"> Keyspace name validation in TopoServer

Prior to v17, it was possible to create a keyspace with invalid characters, which would then be inaccessible to various cluster management operations.

Now, the TopoServer's `GetKeyspace` and `CreateKeyspace` methods return an error if given an invalid name.

Keyspace names may no longer contain the following characters:
- Forward slash ("/").

### <a id="new-flag"/> New command line flags and behavior

#### <a id="builtin-backup-read-buffering-flags" /> Backup --builtinbackup-file-read-buffer-size and --builtinbackup-file-write-buffer-size
Expand Down
8 changes: 8 additions & 0 deletions go/vt/topo/keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ func (ki *KeyspaceInfo) SetKeyspaceName(name string) {

var ksNameReplacer = strings.NewReplacer("/", "")

// ValidateKeyspaceNames checks if the provided name is a valid name for a
// keyspace.
//
// If it is valid, the original name is returned with no error. If it is
// invalid, the name with all invalid characters removed is returned, along
// with an error.
//
// As of v17, "all invalid characters" is just the forward slash ("/").
func ValidateKeyspaceName(name string) (string, error) {
if validated := ksNameReplacer.Replace(name); name != validated {
return validated, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "keyspace name %s contains invalid characters; expected %s instead", name, validated)
Expand Down

0 comments on commit 38c662f

Please sign in to comment.