diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index c416af11e3..40720e702b 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -333,7 +333,7 @@ Flags: --stream_buffer_size int the number of bytes sent from vtgate for each stream call. It's recommended to keep this value in sync with vttablet's query-server-config-stream-buffer-size. (default 32768) --stream_health_buffer_size uint max streaming health entries to buffer per streaming health client (default 20) --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class - --table_gc_lifecycle string States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implcitly always included) (default "hold,purge,evac,drop") + --table_gc_lifecycle string States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implicitly always included) (default "hold,purge,evac,drop") --tablet_dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. --tablet_filters strings Specifies a comma-separated list of 'keyspace|shard_name or keyrange' values to filter the tablets to watch. --tablet_health_keep_alive duration close streaming tablet health connection if there are no requests for this long (default 5m0s) @@ -349,7 +349,7 @@ Flags: --tablet_refresh_interval duration Tablet refresh interval. (default 1m0s) --tablet_refresh_known_tablets Whether to reload the tablet's address/port map from topo in case they change. (default true) --tablet_url_template string Format string describing debug tablet url formatting. See getTabletDebugURL() for how to customize this. (default "http://{{ "{{.GetTabletHostPort}}" }}") - --throttle_tablet_types string Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' aways implicitly included (default "replica") + --throttle_tablet_types string Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' always implicitly included (default "replica") --topo_consul_lock_delay duration LockDelay for consul session. (default 15s) --topo_consul_lock_session_checks string List of checks for consul session. (default "serfHealth") --topo_consul_lock_session_ttl string TTL for consul session. diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index c0926a6f70..7dc29a140b 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -336,7 +336,7 @@ Flags: --table-acl-config string path to table access checker config file; send SIGHUP to reload this file --table-acl-config-reload-interval duration Ticker to reload ACLs. Duration flag, format e.g.: 30s. Default: do not reload --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class - --table_gc_lifecycle string States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implcitly always included) (default "hold,purge,evac,drop") + --table_gc_lifecycle string States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implicitly always included) (default "hold,purge,evac,drop") --tablet-path string tablet alias --tablet_config string YAML file config for tablet --tablet_dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. @@ -355,7 +355,7 @@ Flags: --tablet_manager_grpc_server_name string the server name to use to validate server certificate --tablet_manager_protocol string Protocol to use to make tabletmanager RPCs to vttablets. (default "grpc") --tablet_protocol string Protocol to use to make queryservice RPCs to vttablets. (default "grpc") - --throttle_tablet_types string Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' aways implicitly included (default "replica") + --throttle_tablet_types string Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' always implicitly included (default "replica") --topo_consul_lock_delay duration LockDelay for consul session. (default 15s) --topo_consul_lock_session_checks string List of checks for consul session. (default "serfHealth") --topo_consul_lock_session_ttl string TTL for consul session. diff --git a/go/vt/schemadiff/schema.go b/go/vt/schemadiff/schema.go index 40848a9653..c34f05b7a9 100644 --- a/go/vt/schemadiff/schema.go +++ b/go/vt/schemadiff/schema.go @@ -128,7 +128,7 @@ func NewSchemaFromSQL(sql string) (*Schema, error) { return NewSchemaFromStatements(statements) } -// getForeignKeyParentTableNames analyzes a CREATE TABLE definition and extracts all referened foreign key tables names. +// getForeignKeyParentTableNames analyzes a CREATE TABLE definition and extracts all referenced foreign key tables names. // A table name may appear twice in the result output, if it is referenced by more than one foreign key func getForeignKeyParentTableNames(createTable *sqlparser.CreateTable) (names []string) { for _, cs := range createTable.TableSpec.Constraints { @@ -266,7 +266,7 @@ func (s *Schema) normalize() error { // It's possible that there's never been any tables in this schema. Which means // iterationLevel remains zero. // To deal with views, we must have iterationLevel at least 1. This is because any view reads - // from _something_: at the very least it reads from DUAL (inplicitly or explicitly). Which + // from _something_: at the very least it reads from DUAL (implicitly or explicitly). Which // puts the view at a higher level. if iterationLevel < 1 { iterationLevel = 1 @@ -451,7 +451,7 @@ func (s *Schema) diff(other *Schema, hints *DiffHints) (diffs []EntityDiff, err if _, ok := other.named[e.Name()]; !ok { // other schema does not have the entity // Entities are sorted in foreign key CREATE TABLE valid order (create parents first, then children). - // When issuing DROPs, we want to reverse that order. We want to first frop children, then parents. + // When issuing DROPs, we want to reverse that order. We want to first do it for children, then parents. // Instead of analyzing all relationships again, we just reverse the entire order of DROPs, foreign key // related or not. dropDiffs = append([]EntityDiff{e.Drop()}, dropDiffs...) @@ -766,10 +766,10 @@ func (s *Schema) Apply(diffs []EntityDiff) (*Schema, error) { return dup, nil } -// SchemaDiff calulates a rich diff between this schema and the given schema. It builds on top of diff(): +// SchemaDiff calculates a rich diff between this schema and the given schema. It builds on top of diff(): // on top of the list of diffs that can take this schema into the given schema, this function also // evaluates the dependencies between those diffs, if any, and the resulting SchemaDiff object offers OrderedDiffs(), -// the safe ordering of diffs that, when appleid sequentially, does not produce any conflicts and keeps schema valid +// the safe ordering of diffs that, when applied sequentially, does not produce any conflicts and keeps schema valid // at each step. func (s *Schema) SchemaDiff(other *Schema, hints *DiffHints) (*SchemaDiff, error) { diffs, err := s.diff(other, hints) diff --git a/go/vt/schemadiff/schema_diff.go b/go/vt/schemadiff/schema_diff.go index 8fef7c29d2..1429da088c 100644 --- a/go/vt/schemadiff/schema_diff.go +++ b/go/vt/schemadiff/schema_diff.go @@ -92,7 +92,7 @@ func permutateDiffs(ctx context.Context, diffs []EntityDiff, callback func([]Ent if len(diffs) == 0 { return false, nil } - // Sort by a heristic (DROPs first, ALTERs next, CREATEs last). This ordering is then used first in the permutation + // Sort by a heuristic (DROPs first, ALTERs next, CREATEs last). This ordering is then used first in the permutation // search and serves as seed for the rest of permutations. return permDiff(ctx, diffs, callback, 0) @@ -296,7 +296,7 @@ func (d *SchemaDiff) OrderedDiffs(ctx context.Context) ([]EntityDiff, error) { for i, diff := range d.UnorderedDiffs() { unorderedDiffsMap[diff.CanonicalStatementString()] = i } - // The order of classes in the quivalence relation is, generally speaking, loyal to the order of original diffs. + // The order of classes in the equivalence relation is, generally speaking, loyal to the order of original diffs. for _, class := range d.r.OrderedClasses() { classDiffs := []EntityDiff{} // Which diffs are in this equivalence class? diff --git a/go/vt/schemadiff/schema_test.go b/go/vt/schemadiff/schema_test.go index 79bf44117e..3a609bdf76 100644 --- a/go/vt/schemadiff/schema_test.go +++ b/go/vt/schemadiff/schema_test.go @@ -716,7 +716,7 @@ func TestViewReferences(t *testing.T) { } // TestMassiveSchema loads thousands of tables into one schema, and thousands of tables, some of which are different, into another schema. -// It compares the two shemas. +// It compares the two schemas. // The objective of this test is to verify that execution time is _reasonable_. Since this will run in GitHub CI, which is very slow, we allow // for 1 minute total for all operations. func TestMassiveSchema(t *testing.T) { diff --git a/go/vt/schemadiff/semantics.go b/go/vt/schemadiff/semantics.go index 7cfe127cf5..ee7ef4e3b1 100644 --- a/go/vt/schemadiff/semantics.go +++ b/go/vt/schemadiff/semantics.go @@ -34,7 +34,7 @@ var semanticKS = &vindexes.Keyspace{ var _ semantics.SchemaInformation = (*declarativeSchemaInformation)(nil) -// declarativeSchemaInformation is a utility wrapper arounf FakeSI, and adds a few utility functions +// declarativeSchemaInformation is a utility wrapper around FakeSI, and adds a few utility functions // to make it more simple and accessible to schemadiff's logic. type declarativeSchemaInformation struct { Tables map[string]*vindexes.Table diff --git a/go/vt/schemadiff/table.go b/go/vt/schemadiff/table.go index 3f25688972..eef39d51fa 100644 --- a/go/vt/schemadiff/table.go +++ b/go/vt/schemadiff/table.go @@ -1159,7 +1159,7 @@ func (c *CreateTableEntity) diffOptions(alterTable *sqlparser.AlterTable, // rangePartitionsAddedRemoved returns true when: // - both table partitions are RANGE type -// - there is exactly one consequitive non-empty shared sequence of partitions (same names, same range values, in same order) +// - there is exactly one consecutive non-empty shared sequence of partitions (same names, same range values, in same order) // - table1 may have non-empty list of partitions _preceding_ this sequence, and table2 may not // - table2 may have non-empty list of partitions _following_ this sequence, and table1 may not func (c *CreateTableEntity) isRangePartitionsRotation( @@ -1189,7 +1189,7 @@ func (c *CreateTableEntity) isRangePartitionsRotation( definitions1 = definitions1[1:] } if len(definitions1) == 0 { - // We've exhaused definition1 trying to find a shared partition with definitions2. Nothing found. + // We've exhausted definition1 trying to find a shared partition with definitions2. Nothing found. // so there is no shared sequence between the two tables. return false, nil, nil } @@ -1251,9 +1251,9 @@ func (c *CreateTableEntity) diffPartitions(alterTable *sqlparser.AlterTable, return nil, nil default: // partitioning was changed - // For most cases, we produce a complete re-partitioing schema: we don't try and figure out the minimal + // For most cases, we produce a complete re-partitioning schema: we don't try and figure out the minimal // needed change. For example, maybe the minimal change is to REORGANIZE a specific partition and split - // into two, thus unaffecting the rest of the partitions. But we don't evaluate that, we just set a + // into two, thus not affecting the rest of the partitions. But we don't evaluate that, we just set a // complete new ALTER TABLE ... PARTITION BY statement. // The idea is that it doesn't matter: we're not looking to do optimal in-place ALTERs, we run // Online DDL alters, where we create a new table anyway. Thus, the optimization is meaningless. @@ -1602,7 +1602,7 @@ func (c *CreateTableEntity) diffColumns(alterTable *sqlparser.AlterTable, modifyColumnDiff := t1ColEntity.ColumnDiff(t2ColEntity, hints) if modifyColumnDiff == nil { // even if there's no apparent change, there can still be implicit changes - // it is possible that the table charset is changed. the column may be some col1 TEXT NOT NULL, possibly in both varsions 1 and 2, + // it is possible that the table charset is changed. the column may be some col1 TEXT NOT NULL, possibly in both versions 1 and 2, // but implicitly the column has changed its characters set. So we need to explicitly ass a MODIFY COLUMN statement, so that // MySQL rebuilds it. if tableCharsetChanged && t2ColEntity.IsTextual() && t2Col.Type.Charset.Name == "" { @@ -1684,7 +1684,7 @@ func heuristicallyDetectColumnRenames( // - the DROP and ADD column definitions are identical other than the column name, and // - the DROPped and ADDded column are both FIRST, or they come AFTER the same column, and // - the DROPped and ADDded column are both last, or they come before the same column - // This v1 chcek therefore cannot handle a case where two successive columns are renamed. + // This v1 check therefore cannot handle a case where two successive columns are renamed. // the problem is complex, and with successive renamed, or drops and adds, it can be // impossible to tell apart different scenarios. // At any case, once we heuristically decide that we found a RENAME, we cancel the DROP, diff --git a/go/vt/sidecardb/sidecardb.go b/go/vt/sidecardb/sidecardb.go index 0bb6461160..92d416f9d3 100644 --- a/go/vt/sidecardb/sidecardb.go +++ b/go/vt/sidecardb/sidecardb.go @@ -361,7 +361,7 @@ func (si *schemaInit) getCurrentSchema(tableName string) (string, error) { } // findTableSchemaDiff gets the diff which needs to be applied -// to the current table schema in order toreach the desired one. +// to the current table schema in order to reach the desired one. // The result will be an empty string if they match. // This will be a CREATE statement if the table does not exist // or an ALTER if the table exists but has a different schema. diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index 38029f0e79..d597ec4950 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -3986,7 +3986,7 @@ func TestDeleteTablets(t *testing.T) { // value anymore defer unlock(&lerr) - // we do, however, care that the lock context gets propogated + // we do, however, care that the lock context gets propagated // both to additional calls to lock, and to the actual RPC call. ctx = lctx } diff --git a/go/vt/vtctl/grpcvtctldserver/testutil/test_backupstorage.go b/go/vt/vtctl/grpcvtctldserver/testutil/test_backupstorage.go index dc273dcb96..1097d2994c 100644 --- a/go/vt/vtctl/grpcvtctldserver/testutil/test_backupstorage.go +++ b/go/vt/vtctl/grpcvtctldserver/testutil/test_backupstorage.go @@ -104,7 +104,7 @@ func (a handlesByName) Less(i, j int) bool { return a[i].Name() < a[j].Name() } // *backupstorage.BackupStorageImplementation to this value before use. const BackupStorageImplementation = "grpcvtctldserver.testutil" -// BackupStorage is the singleton test backupstorage.BackupStorage intastnce. It +// BackupStorage is the singleton test backupstorage.BackupStorage instance. It // is public and singleton to allow tests to both mutate and assert against its // state. var BackupStorage = &backupStorage{ diff --git a/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go b/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go index ba7c8477d2..20c51968a1 100644 --- a/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go +++ b/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go @@ -1348,7 +1348,7 @@ func (fake *TabletManagerClient) UndoDemotePrimary(ctx context.Context, tablet * return assert.AnError } -// VReplicationExec is part of the tmclient.TabletManagerCLient interface. +// VReplicationExec is part of the tmclient.TabletManagerClient interface. func (fake *TabletManagerClient) VReplicationExec(ctx context.Context, tablet *topodatapb.Tablet, query string) (*querypb.QueryResult, error) { if fake.VReplicationExecResults == nil { return nil, assert.AnError @@ -1393,7 +1393,7 @@ func (fake *TabletManagerClient) VReplicationExec(ctx context.Context, tablet *t return nil, assert.AnError } -// CheckThrottler is part of the tmclient.TabletManagerCLient interface. +// CheckThrottler is part of the tmclient.TabletManagerClient interface. func (fake *TabletManagerClient) CheckThrottler(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { if fake.CheckThrottlerResults == nil { return nil, assert.AnError diff --git a/go/vt/vtctl/internal/grpcshim/bidi_stream.go b/go/vt/vtctl/internal/grpcshim/bidi_stream.go index a620cb929a..92e7c24068 100644 --- a/go/vt/vtctl/internal/grpcshim/bidi_stream.go +++ b/go/vt/vtctl/internal/grpcshim/bidi_stream.go @@ -101,7 +101,7 @@ type BidiStream struct { // NewBidiStream returns a BidiStream ready for embedded use. The provided ctx // will be used for the stream context, and types embedding BidiStream should -// check context cancellation/expiriation in their respective Recv and Send +// check context cancellation/expiration in their respective Recv and Send // methods. // // See the documentation on BidiStream for example usage. @@ -123,7 +123,7 @@ func (bs *BidiStream) Closed() <-chan struct{} { // IsClosed returns true if the stream has been closed for sending. // -// It is a conveince function for attempting to select on the channel returned +// It is a convenience function for attempting to select on the channel returned // by bs.Closed(). func (bs *BidiStream) IsClosed() bool { select { diff --git a/go/vt/vtctl/reparentutil/emergency_reparenter.go b/go/vt/vtctl/reparentutil/emergency_reparenter.go index 7f190a4d99..607fec700b 100644 --- a/go/vt/vtctl/reparentutil/emergency_reparenter.go +++ b/go/vt/vtctl/reparentutil/emergency_reparenter.go @@ -697,7 +697,7 @@ func (erp *EmergencyReparenter) identifyPrimaryCandidate( } } // Unreachable code. - // We should have found atleast 1 tablet in the valid list. + // We should have found at least 1 tablet in the valid list. // If the list is empty, then we should have errored out much sooner. return nil, vterrors.Errorf(vtrpc.Code_INTERNAL, "unreachable - did not find a valid primary candidate even though the valid candidate list was non-empty") } diff --git a/go/vt/vtctl/reparentutil/replication_test.go b/go/vt/vtctl/reparentutil/replication_test.go index ed7bd152e9..b7a2bcb07e 100644 --- a/go/vt/vtctl/reparentutil/replication_test.go +++ b/go/vt/vtctl/reparentutil/replication_test.go @@ -54,7 +54,7 @@ func TestFindValidEmergencyReparentCandidates(t *testing.T) { statusMap map[string]*replicationdatapb.StopReplicationStatus primaryStatusMap map[string]*replicationdatapb.PrimaryStatus // Note: for these tests, it's simpler to compare keys than actual - // mysql.Postion structs, which are just thin wrappers around the + // mysql.Position structs, which are just thin wrappers around the // mysql.GTIDSet interface. If a tablet alias makes it into the map, we // know it was chosen by the method, and that either // mysql.DecodePosition was successful (in the primary case) or diff --git a/go/vt/vtctl/vdiff_env_test.go b/go/vt/vtctl/vdiff_env_test.go index 955d2673d2..b5324e7bd6 100644 --- a/go/vt/vtctl/vdiff_env_test.go +++ b/go/vt/vtctl/vdiff_env_test.go @@ -43,7 +43,7 @@ import ( const ( // vdiffStopPosition is the default stop position for the target vreplication. - // It can be overridden with the positons argument to newTestVDiffEnv. + // It can be overridden with the positions argument to newTestVDiffEnv. vdiffStopPosition = "MySQL56/d834e6b8-7cbf-11ed-a1eb-0242ac120002:1-892" // vdiffSourceGtid should be the position reported by the source side VStreamResults. // It's expected to be higher the vdiffStopPosition. diff --git a/go/vt/vtctl/vtctldclient/client.go b/go/vt/vtctl/vtctldclient/client.go index 5b90a08ecd..6e0c97bb8a 100644 --- a/go/vt/vtctl/vtctldclient/client.go +++ b/go/vt/vtctl/vtctldclient/client.go @@ -22,7 +22,7 @@ type Factory func(addr string) (VtctldClient, error) var registry = map[string]Factory{} // Register adds a VtctldClient factory for the given name (protocol). -// Attempting to register mulitple factories for the same protocol is a fatal +// Attempting to register multiple factories for the same protocol is a fatal // error. func Register(name string, factory Factory) { if _, ok := registry[name]; ok { diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index 3810d7a294..95f1ecd42d 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -141,7 +141,7 @@ var ( type Server struct { ts *topo.Server tmc tmclient.TabletManagerClient - // Limt the number of concurrent background goroutines if needed. + // Limit the number of concurrent background goroutines if needed. sem *semaphore.Weighted } diff --git a/go/vt/vtctl/workflow/vexec/query_plan.go b/go/vt/vtctl/workflow/vexec/query_plan.go index e6a9cb3a54..52e7ee00b6 100644 --- a/go/vt/vtctl/workflow/vexec/query_plan.go +++ b/go/vt/vtctl/workflow/vexec/query_plan.go @@ -31,7 +31,7 @@ import ( querypb "vitess.io/vitess/go/vt/proto/query" ) -// QueryPlan defines the interface to executing a preprared vexec query on one +// QueryPlan defines the interface to executing a prepared vexec query on one // or more tablets. Implementations should ensure that it is safe to call the // various Execute* methods repeatedly and in multiple goroutines. type QueryPlan interface { diff --git a/go/vt/vtgate/endtoend/vstream_test.go b/go/vt/vtgate/endtoend/vstream_test.go index 42dd6e3d2a..871e6cf98c 100644 --- a/go/vt/vtgate/endtoend/vstream_test.go +++ b/go/vt/vtgate/endtoend/vstream_test.go @@ -493,7 +493,7 @@ func TestVStreamCopyResume(t *testing.T) { // Also, to ensure that the client can resume properly, make sure that // the Fields value is present in the sqltypes.Result field and not missing. // It's not guaranteed that BOTH shards have streamed a row yet as the order - // of events in the stream is non-determinstic. So we check to be sure that + // of events in the stream is non-deterministic. So we check to be sure that // at least one shard has copied rows and thus has a full TableLastPK proto // message. eventStr := ev.String() diff --git a/go/vt/vtgate/engine/insert.go b/go/vt/vtgate/engine/insert.go index e0c90d091a..4fa8eeadce 100644 --- a/go/vt/vtgate/engine/insert.go +++ b/go/vt/vtgate/engine/insert.go @@ -1049,7 +1049,7 @@ func (ins *Insert) executeUnshardedTableQuery(ctx context.Context, vcursor VCurs return 0, nil, err } - // If processGenerateFromValues generated new values, it supercedes + // If processGenerateFromValues generated new values, it supersedes // any ids that MySQL might have generated. If both generated // values, we don't return an error because this behavior // is required to support migration. diff --git a/go/vt/vtgate/engine/rows.go b/go/vt/vtgate/engine/rows.go index 2b81c85145..6ff5c5f2aa 100644 --- a/go/vt/vtgate/engine/rows.go +++ b/go/vt/vtgate/engine/rows.go @@ -34,7 +34,7 @@ type Rows struct { noTxNeeded } -// NewRowsPrimitive returns a new Rows primitie +// NewRowsPrimitive returns a new Rows primitive func NewRowsPrimitive(rows [][]sqltypes.Value, fields []*querypb.Field) Primitive { return &Rows{rows: rows, fields: fields} } diff --git a/go/vt/vtgate/engine/semi_join.go b/go/vt/vtgate/engine/semi_join.go index d291b348da..8ab0465249 100644 --- a/go/vt/vtgate/engine/semi_join.go +++ b/go/vt/vtgate/engine/semi_join.go @@ -43,7 +43,7 @@ type SemiJoin struct { // Vars defines the list of SemiJoinVars that need to // be built from the LHS result before invoking - // the RHS subqquery. + // the RHS subquery. Vars map[string]int `json:",omitempty"` } diff --git a/go/vt/vtgate/executor_select_test.go b/go/vt/vtgate/executor_select_test.go index 8f9fe06491..09467e8540 100644 --- a/go/vt/vtgate/executor_select_test.go +++ b/go/vt/vtgate/executor_select_test.go @@ -4170,7 +4170,7 @@ func TestWarmingReads(t *testing.T) { executor.normalize = true session := NewSafeSession(&vtgatepb.Session{TargetString: KsTestUnsharded}) - // Since queries on the replica will run in a separate go-routine, we need sycnronization for the Queries field in the sandboxconn. + // Since queries on the replica will run in a separate go-routine, we need synchronization for the Queries field in the sandboxconn. replica.RequireQueriesLocking() _, err := executor.Execute(ctx, nil, "TestWarmingReads", session, "select age, city from user", map[string]*querypb.BindVariable{}) diff --git a/go/vt/vtgate/executor_test.go b/go/vt/vtgate/executor_test.go index 2a44d0a8b0..38746dea77 100644 --- a/go/vt/vtgate/executor_test.go +++ b/go/vt/vtgate/executor_test.go @@ -640,7 +640,7 @@ func TestExecutorShow(t *testing.T) { lastQuery = sbclookup.Queries[len(sbclookup.Queries)-1].Sql assert.Equal(t, wantQuery, lastQuery, "Got: %v. Want: %v", lastQuery, wantQuery) - // Set desitation keyspace in session + // Set destination keyspace in session session.TargetString = KsTestUnsharded _, err = executor.Execute(ctx, nil, "TestExecute", session, "show create table unknown", nil) require.NoError(t, err) diff --git a/go/vt/vtgate/planbuilder/operators/ast_to_op.go b/go/vt/vtgate/planbuilder/operators/ast_to_op.go index 46286b2778..f6acbadd35 100644 --- a/go/vt/vtgate/planbuilder/operators/ast_to_op.go +++ b/go/vt/vtgate/planbuilder/operators/ast_to_op.go @@ -227,7 +227,7 @@ func createOpFromStmt(ctx *plancontext.PlanningContext, stmt sqlparser.Statement // Now, we can filter the foreign keys further based on the planning context, specifically whether we are running // this query with FOREIGN_KEY_CHECKS off or not. If the foreign key checks are enabled, then we don't need to verify - // the validity of shard-scoped RESTRICT foreign keys, since MySQL will do that for us. Similarily, we don't need to verify + // the validity of shard-scoped RESTRICT foreign keys, since MySQL will do that for us. Similarly, we don't need to verify // if the shard-scoped parent foreign key constraints are valid. switch stmt.(type) { case *sqlparser.Update, *sqlparser.Insert: diff --git a/go/vt/vtgate/planbuilder/operators/operator.go b/go/vt/vtgate/planbuilder/operators/operator.go index 4e58fca921..b165c5345b 100644 --- a/go/vt/vtgate/planbuilder/operators/operator.go +++ b/go/vt/vtgate/planbuilder/operators/operator.go @@ -24,7 +24,7 @@ The operators go through a few phases while planning: All the post-processing - aggregations, sorting, limit etc. are at this stage contained in Horizon structs. We try to push these down under routes, and expand the ones that can't be pushed down into individual operators such as Projection, - Agreggation, Limit, etc. + Aggregation, Limit, etc. 2. Planning Once the initial plan has been fully built, we go through a number of phases. recursively running rewriters on the tree in a fixed point fashion, until we've gone diff --git a/go/vt/vtgate/planbuilder/set.go b/go/vt/vtgate/planbuilder/set.go index 7b1e584132..43d85ee511 100644 --- a/go/vt/vtgate/planbuilder/set.go +++ b/go/vt/vtgate/planbuilder/set.go @@ -60,7 +60,7 @@ func buildSetPlan(stmt *sqlparser.Set, vschema plancontext.VSchema) (*planResult for _, expr := range stmt.Exprs { // AST struct has been prepared before getting here, so no scope here means that // we have a UDV. If the original query didn't explicitly specify the scope, it - // would have been explictly set to sqlparser.SessionStr before reaching this + // would have been explicitly set to sqlparser.SessionStr before reaching this // phase of planning switch expr.Var.Scope { case sqlparser.GlobalScope: diff --git a/go/vt/vtgate/safe_session.go b/go/vt/vtgate/safe_session.go index e2f3c235c9..60d99ab195 100644 --- a/go/vt/vtgate/safe_session.go +++ b/go/vt/vtgate/safe_session.go @@ -435,7 +435,7 @@ func (session *SafeSession) AppendOrUpdate(shardSession *vtgatepb.Session_ShardS if session.queryFromVindex { break } - // isSingle is enforced only for normmal commit order operations. + // isSingle is enforced only for normal commit order operations. if session.isSingleDB(txMode) && len(session.ShardSessions) > 1 { count := actualNoOfShardSession(session.ShardSessions) if count <= 1 { diff --git a/go/vt/vtgate/semantics/analyzer.go b/go/vt/vtgate/semantics/analyzer.go index 44f2481a6b..d7dab3da07 100644 --- a/go/vt/vtgate/semantics/analyzer.go +++ b/go/vt/vtgate/semantics/analyzer.go @@ -406,7 +406,7 @@ func (a *analyzer) filterForeignKeysUsingUpdateExpressions(allChildFks map[Table childFKToUpdExprs[childFk.String(tbl.GetVindexTable())] = ue } } - // If we are setting a column to NULL, then we don't need to verify the existance of an + // If we are setting a column to NULL, then we don't need to verify the existence of an // equivalent row in the parent table, even if this column was part of a foreign key to a parent table. if sqlparser.IsNull(updateExpr.Expr) { continue @@ -458,7 +458,7 @@ func (a *analyzer) filterForeignKeysUsingUpdateExpressions(allChildFks map[Table return cFksNeedsHandling, pFksNeedsHandling, childFKToUpdExprs } -// getAllManagedForeignKeys gets all the foreign keys for the query we are analyzing that Vitess is reposible for managing. +// getAllManagedForeignKeys gets all the foreign keys for the query we are analyzing that Vitess is responsible for managing. func (a *analyzer) getAllManagedForeignKeys() (map[TableSet][]vindexes.ChildFKInfo, map[TableSet][]vindexes.ParentFKInfo, error) { allChildFKs := make(map[TableSet][]vindexes.ChildFKInfo) allParentFKs := make(map[TableSet][]vindexes.ParentFKInfo) diff --git a/go/vt/vtgate/tabletgateway.go b/go/vt/vtgate/tabletgateway.go index 9d62be2d35..1be29459bf 100644 --- a/go/vt/vtgate/tabletgateway.go +++ b/go/vt/vtgate/tabletgateway.go @@ -92,7 +92,7 @@ func createHealthCheck(ctx context.Context, retryDelay, timeout time.Duration, t // NewTabletGateway creates and returns a new TabletGateway func NewTabletGateway(ctx context.Context, hc discovery.HealthCheck, serv srvtopo.Server, localCell string) *TabletGateway { - // hack to accomodate various users of gateway + tests + // hack to accommodate various users of gateway + tests if hc == nil { var topoServer *topo.Server if serv != nil { diff --git a/go/vt/vtgate/tabletgateway_flaky_test.go b/go/vt/vtgate/tabletgateway_flaky_test.go index f625b5599c..917d931d2f 100644 --- a/go/vt/vtgate/tabletgateway_flaky_test.go +++ b/go/vt/vtgate/tabletgateway_flaky_test.go @@ -61,7 +61,7 @@ func TestGatewayBufferingWhenPrimarySwitchesServingState(t *testing.T) { tg := NewTabletGateway(ctx, hc, ts, "cell") defer tg.Close(ctx) - // add a primary tabelt which is serving + // add a primary tablet which is serving sbc := hc.AddTestTablet("cell", host, port, keyspace, shard, tabletType, true, 10, nil) // add a result to the sandbox connection @@ -148,7 +148,7 @@ func TestGatewayBufferingWhileReparenting(t *testing.T) { tg := NewTabletGateway(ctx, hc, ts, "cell") defer tg.Close(ctx) - // add a primary tabelt which is serving + // add a primary tablet which is serving sbc := hc.AddTestTablet("cell", host, port, keyspace, shard, tabletType, true, 10, nil) // also add a replica which is serving sbcReplica := hc.AddTestTablet("cell", hostReplica, portReplica, keyspace, shard, topodatapb.TabletType_REPLICA, true, 0, nil) @@ -279,7 +279,7 @@ func TestInconsistentStateDetectedBuffering(t *testing.T) { tg.retryCount = 0 - // add a primary tabelt which is serving + // add a primary tablet which is serving sbc := hc.AddTestTablet("cell", host, port, keyspace, shard, tabletType, true, 10, nil) // add a result to the sandbox connection diff --git a/go/vt/vtgate/vindexes/cfc_test.go b/go/vt/vtgate/vindexes/cfc_test.go index 553d36de6c..aaf639adec 100644 --- a/go/vt/vtgate/vindexes/cfc_test.go +++ b/go/vt/vtgate/vindexes/cfc_test.go @@ -199,7 +199,7 @@ func TestCFCComputeKsid(t *testing.T) { testName: "misaligned prefix", id: [][]byte{{3, 4, 5}, {1}}, prefix: true, - // use the first component that's availabe + // use the first component that's available expected: expectedHash([][]byte{{3, 4, 5}}), err: nil, }, @@ -207,7 +207,7 @@ func TestCFCComputeKsid(t *testing.T) { testName: "misaligned prefix", id: [][]byte{{3, 4}}, prefix: true, - // use the first component that's availabe + // use the first component that's available expected: nil, err: nil, }, @@ -286,7 +286,7 @@ func TestCFCComputeKsidXxhash(t *testing.T) { testName: "misaligned prefix", id: [][]byte{{3, 4, 5}, {1}}, prefix: true, - // use the first component that's availabe + // use the first component that's available expected: expectedHashXX([][]byte{{3, 4, 5}}), err: nil, }, @@ -294,7 +294,7 @@ func TestCFCComputeKsidXxhash(t *testing.T) { testName: "misaligned prefix", id: [][]byte{{3, 4}}, prefix: true, - // use the first component that's availabe + // use the first component that's available expected: nil, err: nil, }, diff --git a/go/vt/vtgate/vindexes/lookup_hash.go b/go/vt/vtgate/vindexes/lookup_hash.go index de3d078f55..4a4c6f7a6b 100644 --- a/go/vt/vtgate/vindexes/lookup_hash.go +++ b/go/vt/vtgate/vindexes/lookup_hash.go @@ -242,7 +242,7 @@ func (lh *LookupHash) MarshalJSON() ([]byte, error) { return json.Marshal(lh.lkp) } -// UnknownParams satisifes the ParamValidating interface. +// UnknownParams satisfies the ParamValidating interface. func (lh *LookupHash) UnknownParams() []string { return lh.unknownParams } @@ -265,7 +265,7 @@ func unhashList(ksids [][]byte) ([]sqltypes.Value, error) { // LookupHashUnique defines a vindex that uses a lookup table. // The table is expected to define the id column as unique. It's // Unique and a Lookup. -// Warning: This Vindex is being depcreated in favor of LookupUnique +// Warning: This Vindex is being deprecated in favor of LookupUnique type LookupHashUnique struct { name string writeOnly bool diff --git a/go/vt/vtgate/vindexes/lookup_internal.go b/go/vt/vtgate/vindexes/lookup_internal.go index dac6ea8c27..b793d57c3c 100644 --- a/go/vt/vtgate/vindexes/lookup_internal.go +++ b/go/vt/vtgate/vindexes/lookup_internal.go @@ -356,7 +356,7 @@ nextRow: // Delete deletes the association between ids and value. // rowsColValues contains all the rows that are being deleted. // For each row, we store the value of each column defined in the vindex. -// value cointains the keyspace_id of the vindex entry being deleted. +// value contains the keyspace_id of the vindex entry being deleted. // // Given the following information in a vindex table with two columns: // diff --git a/go/vt/vtgate/vindexes/lookup_unicodeloosemd5_hash.go b/go/vt/vtgate/vindexes/lookup_unicodeloosemd5_hash.go index 070aee9030..f7af93187d 100644 --- a/go/vt/vtgate/vindexes/lookup_unicodeloosemd5_hash.go +++ b/go/vt/vtgate/vindexes/lookup_unicodeloosemd5_hash.go @@ -56,7 +56,7 @@ func init() { // LookupUnicodeLooseMD5Hash defines a vindex that uses a lookup table. // The table is expected to define the id column as unique. It's // NonUnique and a Lookup and stores the from value in a hashed form. -// Warning: This Vindex is being depcreated in favor of Lookup +// Warning: This Vindex is being deprecated in favor of Lookup type LookupUnicodeLooseMD5Hash struct { name string writeOnly bool @@ -246,7 +246,7 @@ func (lh *LookupUnicodeLooseMD5Hash) UnknownParams() []string { // LookupUnicodeLooseMD5HashUnique defines a vindex that uses a lookup table. // The table is expected to define the id column as unique. It's // Unique and a Lookup and will store the from value in a hashed format. -// Warning: This Vindex is being depcreated in favor of LookupUnique +// Warning: This Vindex is being deprecated in favor of LookupUnique type LookupUnicodeLooseMD5HashUnique struct { name string writeOnly bool diff --git a/go/vt/vtgate/vindexes/vschema_test.go b/go/vt/vtgate/vindexes/vschema_test.go index 92c95d6467..ebcb39fef2 100644 --- a/go/vt/vtgate/vindexes/vschema_test.go +++ b/go/vt/vtgate/vindexes/vschema_test.go @@ -414,7 +414,7 @@ func TestVSchemaForeignKeys(t *testing.T) { vschema := BuildVSchema(&good) require.NoError(t, vschema.Keyspaces["main"].Error) - // add fk containst a keyspace. + // add fk constraints to a keyspace. vschema.AddForeignKey("main", "t1", &sqlparser.ForeignKeyDefinition{ Source: sqlparser.Columns{sqlparser.NewIdentifierCI("c2")}, ReferenceDefinition: &sqlparser.ReferenceDefinition{ @@ -2987,7 +2987,7 @@ func TestReferenceTableAndSourceAreGloballyRoutable(t *testing.T) { _, err = vs.FindTable("sharded", "t1") require.NoError(t, err) // If the source of a reference table requires explicit routing, then - // neither the reference table nor its souce can be globally routed. + // neither the reference table nor its source can be globally routed. _, err = vs.FindTable("", "t1") require.Error(t, err) require.EqualError(t, err, "table t1 not found") diff --git a/go/vt/vtgate/vstream_manager.go b/go/vt/vtgate/vstream_manager.go index ffb8989ca5..08553969a5 100644 --- a/go/vt/vtgate/vstream_manager.go +++ b/go/vt/vtgate/vstream_manager.go @@ -705,7 +705,7 @@ func (vs *vstream) streamFromTablet(ctx context.Context, sgtid *binlogdatapb.Sha // shouldRetry determines whether we should exit immediately or retry the vstream. // The first return value determines if the error can be retried, while the second -// indicates whether the tablet with which the error occurred should be ommitted +// indicates whether the tablet with which the error occurred should be omitted // from the candidate list of tablets to choose from on the retry. // // An error should be retried if it is expected to be transient. diff --git a/go/vt/vtorc/config/config.go b/go/vt/vtorc/config/config.go index 83a39303ac..03067d289a 100644 --- a/go/vt/vtorc/config/config.go +++ b/go/vt/vtorc/config/config.go @@ -44,7 +44,7 @@ const ( DiscoveryQueueMaxStatisticsSize = 120 DiscoveryCollectionRetentionSeconds = 120 UnseenInstanceForgetHours = 240 // Number of hours after which an unseen instance is forgotten - FailureDetectionPeriodBlockMinutes = 60 // The time for which an instance's failure discovery is kept "active", so as to avoid concurrent "discoveries" of the instance's failure; this preceeds any recovery process, if any. + FailureDetectionPeriodBlockMinutes = 60 // The time for which an instance's failure discovery is kept "active", so as to avoid concurrent "discoveries" of the instance's failure; this precedes any recovery process, if any. ) var ( @@ -85,7 +85,7 @@ func RegisterFlags(fs *pflag.FlagSet) { } // Configuration makes for vtorc configuration input, which can be provided by user via JSON formatted file. -// Some of the parameteres have reasonable default values, and some (like database credentials) are +// Some of the parameters have reasonable default values, and some (like database credentials) are // strictly expected from user. // TODO(sougou): change this to yaml parsing, and possible merge with tabletenv. type Configuration struct { diff --git a/go/vt/vtorc/db/db.go b/go/vt/vtorc/db/db.go index d565c9bbdc..92657eddc3 100644 --- a/go/vt/vtorc/db/db.go +++ b/go/vt/vtorc/db/db.go @@ -88,7 +88,7 @@ func registerVTOrcDeployment(db *sql.DB) error { } // deployStatements will issue given sql queries that are not already known to be deployed. -// This iterates both lists (to-run and already-deployed) and also verifies no contraditions. +// This iterates both lists (to-run and already-deployed) and also verifies no contradictions. func deployStatements(db *sql.DB, queries []string) error { tx, err := db.Begin() if err != nil { diff --git a/go/vt/vtorc/inst/analysis_dao.go b/go/vt/vtorc/inst/analysis_dao.go index 25082f133d..749827f006 100644 --- a/go/vt/vtorc/inst/analysis_dao.go +++ b/go/vt/vtorc/inst/analysis_dao.go @@ -521,7 +521,7 @@ func GetReplicationAnalysis(keyspace string, shard string, hints *ReplicationAna a.Description = "Primary cannot be reached by vtorc and all of its replicas are lagging" // } else if a.IsPrimary && !a.LastCheckValid && !a.LastCheckPartialSuccess && a.CountValidReplicas > 0 && a.CountValidReplicatingReplicas > 0 { - // partial success is here to redice noise + // partial success is here to reduce noise a.Analysis = UnreachablePrimary a.Description = "Primary cannot be reached by vtorc but it has replicating replicas; possibly a network/host issue" // diff --git a/go/vt/vtorc/inst/binlog.go b/go/vt/vtorc/inst/binlog.go index 066c2f5c59..9c115e4e45 100644 --- a/go/vt/vtorc/inst/binlog.go +++ b/go/vt/vtorc/inst/binlog.go @@ -68,7 +68,7 @@ func (binlogCoordinates BinlogCoordinates) String() string { return binlogCoordinates.DisplayString() } -// Equals tests equality of this corrdinate and another one. +// Equals tests equality of this coordinate and another one. func (binlogCoordinates *BinlogCoordinates) Equals(other *BinlogCoordinates) bool { if other == nil { return false @@ -106,8 +106,8 @@ func (binlogCoordinates *BinlogCoordinates) FileSmallerThan(other *BinlogCoordin return binlogCoordinates.LogFile < other.LogFile } -// FileNumberDistance returns the numeric distance between this corrdinate's file number and the other's. -// Effectively it means "how many roatets/FLUSHes would make these coordinates's file reach the other's" +// FileNumberDistance returns the numeric distance between this coordinate's file number and the other's. +// Effectively it means "how many rotates/FLUSHes would make these coordinates's file reach the other's" func (binlogCoordinates *BinlogCoordinates) FileNumberDistance(other *BinlogCoordinates) int { thisNumber, _ := binlogCoordinates.FileNumber() otherNumber, _ := other.FileNumber() @@ -163,7 +163,7 @@ func (binlogCoordinates *BinlogCoordinates) NextFileCoordinates() (BinlogCoordin return result, nil } -// Detach returns a detahced form of coordinates +// Detach returns a detached form of coordinates func (binlogCoordinates *BinlogCoordinates) Detach() (detachedCoordinates BinlogCoordinates) { detachedCoordinates = BinlogCoordinates{LogFile: fmt.Sprintf("//%s:%d", binlogCoordinates.LogFile, binlogCoordinates.LogPos), LogPos: binlogCoordinates.LogPos} return detachedCoordinates diff --git a/go/vt/vtorc/inst/instance_dao.go b/go/vt/vtorc/inst/instance_dao.go index 01b8a750f5..adac562307 100644 --- a/go/vt/vtorc/inst/instance_dao.go +++ b/go/vt/vtorc/inst/instance_dao.go @@ -89,7 +89,7 @@ func initializeInstanceDao() { cacheInitializationCompleted.Store(true) } -// ExecDBWriteFunc chooses how to execute a write onto the database: whether synchronuously or not +// ExecDBWriteFunc chooses how to execute a write onto the database: whether synchronously or not func ExecDBWriteFunc(f func() error) error { m := query.NewMetric() @@ -1105,7 +1105,7 @@ func ForgetInstance(tabletAlias string) error { return nil } -// ForgetLongUnseenInstances will remove entries of all instacnes that have long since been last seen. +// ForgetLongUnseenInstances will remove entries of all instances that have long since been last seen. func ForgetLongUnseenInstances() error { sqlResult, err := db.ExecVTOrc(` delete diff --git a/go/vt/vtorc/logic/topology_recovery.go b/go/vt/vtorc/logic/topology_recovery.go index d3e73c0088..cf99e34e42 100644 --- a/go/vt/vtorc/logic/topology_recovery.go +++ b/go/vt/vtorc/logic/topology_recovery.go @@ -584,7 +584,7 @@ func runEmergentOperations(analysisEntry *inst.ReplicationAnalysis) { } // executeCheckAndRecoverFunction will choose the correct check & recovery function based on analysis. -// It executes the function synchronuously +// It executes the function synchronously func executeCheckAndRecoverFunction(analysisEntry *inst.ReplicationAnalysis) (err error) { countPendingRecoveries.Add(1) defer countPendingRecoveries.Add(-1) diff --git a/go/vt/vtorc/logic/topology_recovery_dao.go b/go/vt/vtorc/logic/topology_recovery_dao.go index c835b9ecfe..4a7a6c77ef 100644 --- a/go/vt/vtorc/logic/topology_recovery_dao.go +++ b/go/vt/vtorc/logic/topology_recovery_dao.go @@ -369,7 +369,7 @@ func acknowledgeRecoveries(owner string, comment string, markEndRecovery bool, w return rows, err } -// AcknowledgeInstanceCompletedRecoveries marks active and COMPLETED recoveries for given instane as acknowledged. +// AcknowledgeInstanceCompletedRecoveries marks active and COMPLETED recoveries for given instance as acknowledged. // This also implied clearing their active period, which in turn enables further recoveries on those topologies func AcknowledgeInstanceCompletedRecoveries(tabletAlias string, owner string, comment string) (countAcknowledgedEntries int64, err error) { whereClause := ` diff --git a/go/vt/vtorc/logic/topology_recovery_status.go b/go/vt/vtorc/logic/topology_recovery_status.go index d1195963ba..d128a0637b 100644 --- a/go/vt/vtorc/logic/topology_recovery_status.go +++ b/go/vt/vtorc/logic/topology_recovery_status.go @@ -7,7 +7,7 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreedto in writing, software +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and diff --git a/go/vt/vtorc/logic/vtorc.go b/go/vt/vtorc/logic/vtorc.go index 02fb41daa2..f637956fbf 100644 --- a/go/vt/vtorc/logic/vtorc.go +++ b/go/vt/vtorc/logic/vtorc.go @@ -329,7 +329,7 @@ func onHealthTick() { } } -// ContinuousDiscovery starts an asynchronuous infinite discovery process where instances are +// ContinuousDiscovery starts an asynchronous infinite discovery process where instances are // periodically investigated and their status captured, and long since unseen instances are // purged and forgotten. // nolint SA1015: using time.Tick leaks the underlying ticker diff --git a/go/vt/vtorc/metrics/query/aggregated.go b/go/vt/vtorc/metrics/query/aggregated.go index beece44d53..a284ca6f74 100644 --- a/go/vt/vtorc/metrics/query/aggregated.go +++ b/go/vt/vtorc/metrics/query/aggregated.go @@ -1,5 +1,5 @@ -// Package query provdes query metrics with this file providing -// aggregared metrics based on the underlying values. +// Package query provides query metrics with this file providing +// aggregated metrics based on the underlying values. package query import ( diff --git a/go/vt/vtorc/server/api.go b/go/vt/vtorc/server/api.go index f053336e64..b0112e10ad 100644 --- a/go/vt/vtorc/server/api.go +++ b/go/vt/vtorc/server/api.go @@ -117,7 +117,7 @@ func RegisterVTOrcAPIEndpoints() { } } -// returnAsJSON returns the argument received on the resposeWriter as a json object +// returnAsJSON returns the argument received on the responseWriter as a json object func returnAsJSON(response http.ResponseWriter, code int, stuff any) { response.Header().Set("Content-Type", "application/json; charset=utf-8") response.WriteHeader(code) diff --git a/go/vt/vttablet/endtoend/call_test.go b/go/vt/vttablet/endtoend/call_test.go index 3a42eea378..477a099aa7 100644 --- a/go/vt/vttablet/endtoend/call_test.go +++ b/go/vt/vttablet/endtoend/call_test.go @@ -149,7 +149,7 @@ func TestCallProcedureChangedTx(t *testing.T) { }) } - // This passes as this starts a new transaction by commiting the old transaction implicitly. + // This passes as this starts a new transaction by committing the old transaction implicitly. _, err = client.BeginExecute(`call proc_tx_begin()`, nil, nil) require.NoError(t, err) } diff --git a/go/vt/vttablet/endtoend/compatibility_test.go b/go/vt/vttablet/endtoend/compatibility_test.go index 9b89a60228..4dde4019a9 100644 --- a/go/vt/vttablet/endtoend/compatibility_test.go +++ b/go/vt/vttablet/endtoend/compatibility_test.go @@ -33,7 +33,7 @@ import ( var point12 = "\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00@" -func TestCharaterSet(t *testing.T) { +func TestCharacterSet(t *testing.T) { qr, err := framework.NewClient().Execute("select * from vitess_test where intval=1", nil) if err != nil { t.Fatal(err) diff --git a/go/vt/vttablet/endtoend/framework/client.go b/go/vt/vttablet/endtoend/framework/client.go index 3c06f9b465..e671cb447c 100644 --- a/go/vt/vttablet/endtoend/framework/client.go +++ b/go/vt/vttablet/endtoend/framework/client.go @@ -134,7 +134,7 @@ func (client *QueryClient) CommitPrepared(dtid string) error { return client.server.CommitPrepared(client.ctx, client.target, dtid) } -// RollbackPrepared rollsback a prepared transaction. +// RollbackPrepared rolls back a prepared transaction. func (client *QueryClient) RollbackPrepared(dtid string, originalID int64) error { return client.server.RollbackPrepared(client.ctx, client.target, dtid, originalID) } diff --git a/go/vt/vttablet/endtoend/framework/server.go b/go/vt/vttablet/endtoend/framework/server.go index 4f8043fba5..9e78dc08a8 100644 --- a/go/vt/vttablet/endtoend/framework/server.go +++ b/go/vt/vttablet/endtoend/framework/server.go @@ -135,7 +135,7 @@ func StopServer() { Server.StopService() } -// txReolver transmits dtids to be resolved through ResolveChan. +// txResolver transmits dtids to be resolved through ResolveChan. type txResolver struct { fakerpcvtgateconn.FakeVTGateConn } diff --git a/go/vt/vttablet/endtoend/reserve_test.go b/go/vt/vttablet/endtoend/reserve_test.go index 591512d44c..63b87f9c00 100644 --- a/go/vt/vttablet/endtoend/reserve_test.go +++ b/go/vt/vttablet/endtoend/reserve_test.go @@ -777,9 +777,9 @@ func TestReserveBeginExecuteWithPreQueriesAndCheckConnectionState(t *testing.T) require.NoError(t, err) assert.NotEqual(t, qr1.Rows, qr2.Rows) - // As the transaction is read commited it is not able to see #5. + // As the transaction is read committed it is not able to see #5. assert.Equal(t, `[[INT32(1)] [INT32(2)] [INT32(3)] [INT32(4)]]`, fmt.Sprintf("%v", qr1.Rows)) - // As the transaction is read uncommited it is able to see #4. + // As the transaction is read uncommitted it is able to see #4. assert.Equal(t, `[[INT32(1)] [INT32(2)] [INT32(3)] [INT32(4)] [INT32(5)]]`, fmt.Sprintf("%v", qr2.Rows)) err = rucClient.Commit() @@ -804,7 +804,7 @@ func TestReserveBeginExecuteWithPreQueriesAndCheckConnectionState(t *testing.T) qr2, err = rucClient.Execute(selQuery, nil) require.NoError(t, err) - // As the transaction on read committed client got rollbacked back, table will forget #4. + // As the transaction on read committed client got rolled back, table will forget #4. assert.Equal(t, qr1.Rows, qr2.Rows) assert.Equal(t, `[[INT32(1)] [INT32(2)] [INT32(3)] [INT32(5)]]`, fmt.Sprintf("%v", qr2.Rows)) diff --git a/go/vt/vttablet/grpctabletconn/conn.go b/go/vt/vttablet/grpctabletconn/conn.go index cb97abcbba..2399420a8d 100644 --- a/go/vt/vttablet/grpctabletconn/conn.go +++ b/go/vt/vttablet/grpctabletconn/conn.go @@ -417,7 +417,7 @@ func (conn *gRPCQueryClient) ConcludeTransaction(ctx context.Context, target *qu return nil } -// ReadTransaction returns the metadata for the sepcified dtid. +// ReadTransaction returns the metadata for the specified dtid. func (conn *gRPCQueryClient) ReadTransaction(ctx context.Context, target *querypb.Target, dtid string) (*querypb.TransactionMetadata, error) { conn.mu.RLock() defer conn.mu.RUnlock() diff --git a/go/vt/vttablet/onlineddl/analysis.go b/go/vt/vttablet/onlineddl/analysis.go index 987f09124a..68eee5d4b9 100644 --- a/go/vt/vttablet/onlineddl/analysis.go +++ b/go/vt/vttablet/onlineddl/analysis.go @@ -175,7 +175,7 @@ func analyzeAddRangePartition(alterTable *sqlparser.AlterTable, createTable *sql return op } -// alterOptionAvailableViaInstantDDL chcks if the specific alter option is eligible to run via ALGORITHM=INSTANT +// alterOptionAvailableViaInstantDDL checks if the specific alter option is eligible to run via ALGORITHM=INSTANT // reference: https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html func alterOptionAvailableViaInstantDDL(alterOption sqlparser.AlterOption, createTable *sqlparser.CreateTable, capableOf mysql.CapableOf) (bool, error) { findColumn := func(colName string) *sqlparser.ColumnDefinition { @@ -314,7 +314,7 @@ func alterOptionAvailableViaInstantDDL(alterOption sqlparser.AlterOption, create } // AnalyzeInstantDDL takes declarative CreateTable and AlterTable, as well as a server version, and checks whether it is possible to run the ALTER -// using ALGORITM=INSTANT for that version. +// using ALGORITHM=INSTANT for that version. // This function is INTENTIONALLY public, even though we do not guarantee that it will remain so. func AnalyzeInstantDDL(alterTable *sqlparser.AlterTable, createTable *sqlparser.CreateTable, capableOf mysql.CapableOf) (*SpecialAlterPlan, error) { capable, err := capableOf(mysql.InstantDDLFlavorCapability) diff --git a/go/vt/vttablet/onlineddl/executor.go b/go/vt/vttablet/onlineddl/executor.go index 771a900043..dca3186f7b 100644 --- a/go/vt/vttablet/onlineddl/executor.go +++ b/go/vt/vttablet/onlineddl/executor.go @@ -76,7 +76,7 @@ var ( ) var ( - // fixCompletedTimestampDone fixes a nil `completed_tiemstamp` columns, see + // fixCompletedTimestampDone fixes a nil `completed_timestamp` columns, see // https://github.com/vitessio/vitess/issues/13927 // The fix is in release-18.0 // TODO: remove in release-19.0 @@ -238,7 +238,7 @@ func newGCTableRetainTime() time.Time { } // getMigrationCutOverThreshold returns the cut-over threshold for the given migration. The migration's -// DDL Strategy may excplicitly set the threshold; otherwise, we return the default cut-over threshold. +// DDL Strategy may explicitly set the threshold; otherwise, we return the default cut-over threshold. func getMigrationCutOverThreshold(onlineDDL *schema.OnlineDDL) time.Duration { if threshold, _ := onlineDDL.StrategySetting().CutOverThreshold(); threshold != 0 { return threshold @@ -387,7 +387,7 @@ func (e *Executor) matchesShards(commaDelimitedShards string) bool { } // countOwnedRunningMigrations returns an estimate of current count of running migrations; this is -// normally an accurate number, but can be inexact because the exdcutor peridocially reviews +// normally an accurate number, but can be inexact because the executor periodically reviews // e.ownedRunningMigrations and adds/removes migrations based on actual migration state. func (e *Executor) countOwnedRunningMigrations() (count int) { e.ownedRunningMigrations.Range(func(_, val any) bool { @@ -546,7 +546,7 @@ func (e *Executor) readMySQLVariables(ctx context.Context) (variables *mysqlVari } // createOnlineDDLUser creates a gh-ost or pt-osc user account with all -// neccessary privileges and with a random password +// necessary privileges and with a random password func (e *Executor) createOnlineDDLUser(ctx context.Context) (password string, err error) { conn, err := dbconnpool.NewDBConnection(ctx, e.env.Config().DB.DbaConnector()) if err != nil { @@ -844,7 +844,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er } // This was a best effort optimization. Possibly the error is not nil. Which means we // still have a record of the sentry table, and gcArtifacts() will still be able to take - // care of it in the futre. + // care of it in the future. }() parsed := sqlparser.BuildParsedQuery(sqlCreateSentryTable, sentryTableName) if _, err := e.execQuery(ctx, parsed.Query); err != nil { @@ -904,7 +904,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er waitForRenameProcess := func() error { // This function waits until it finds the RENAME TABLE... query running in MySQL's PROCESSLIST, or until timeout // The function assumes that one of the renamed tables is locked, thus causing the RENAME to block. If nothing - // is locked, then the RENAME will be near-instantaneious and it's unlikely that the function will find it. + // is locked, then the RENAME will be near-instantaneous and it's unlikely that the function will find it. renameWaitCtx, cancel := context.WithTimeout(ctx, migrationCutOverThreshold) defer cancel() @@ -1301,7 +1301,7 @@ func (e *Executor) duplicateCreateTable(ctx context.Context, onlineDDL *schema.O // createDuplicateTableLike creates the table named by `newTableName` in the likeness of onlineDDL.Table // This function emulates MySQL's `CREATE TABLE LIKE ...` statement. The difference is that this function takes control over the generated CONSTRAINT names, -// if any, such that they are detrministic across shards, as well as preserve original names where possible. +// if any, such that they are deterministic across shards, as well as preserve original names where possible. func (e *Executor) createDuplicateTableLike(ctx context.Context, newTableName string, onlineDDL *schema.OnlineDDL, conn *dbconnpool.DBConnection) ( originalShowCreateTable string, constraintMap map[string]string, @@ -1880,7 +1880,7 @@ export MYSQL_PWD // The following sleep() is temporary and artificial. Because we create a new user for this // migration, and because we throttle by replicas, we need to wait for the replicas to be // caught up with the new user creation. Otherwise, the OSC tools will fail connecting to the replicas... - // Once we have a built in throttling service , we will no longe rneed to have the OSC tools probe the + // Once we have a built in throttling service , we will no longer need to have the OSC tools probe the // replicas. Instead, they will consult with our throttling service. // TODO(shlomi): replace/remove this when we have a proper throttling solution time.Sleep(time.Second) @@ -2229,7 +2229,7 @@ func (e *Executor) UnthrottleAllMigrations(ctx context.Context) (result *sqltype return emptyResult, nil } -// scheduleNextMigration attemps to schedule a single migration to run next. +// scheduleNextMigration attempts to schedule a single migration to run next. // possibly there are migrations to run. // The effect of this function is to move a migration from 'queued' state to 'ready' state, is all. func (e *Executor) scheduleNextMigration(ctx context.Context) error { @@ -2257,7 +2257,7 @@ func (e *Executor) scheduleNextMigration(ctx context.Context) error { if !readyToComplete { // see if we need to update ready_to_complete if isImmediateOperation { - // Whether postponsed or not, CREATE and DROP operations, as well as VIEW operations, + // Whether postponed or not, CREATE and DROP operations, as well as VIEW operations, // are inherently "ready to complete" because their operation is immediate. if err := e.updateMigrationReadyToComplete(ctx, uuid, true); err != nil { return err @@ -2364,7 +2364,7 @@ func (e *Executor) reviewImmediateOperations(ctx context.Context, capableOf mysq // reviewQueuedMigration investigates a single migration found in `queued` state. // It analyzes whether the migration can & should be fulfilled immediately (e.g. via INSTANT DDL or just because it's a CREATE or DROP), -// or backfils necessary information if it's a REVERT. +// or backfills necessary information if it's a REVERT. // If all goes well, it sets `reviewed_timestamp` which then allows the state machine to schedule the migration. func (e *Executor) reviewQueuedMigration(ctx context.Context, uuid string, capableOf mysql.CapableOf) error { onlineDDL, row, err := e.readMigration(ctx, uuid) @@ -2702,7 +2702,7 @@ func (e *Executor) evaluateDeclarativeDiff(ctx context.Context, onlineDDL *schem return diff, nil } -// getCompletedMigrationByContextAndSQL chceks if there exists a completed migration with exact same +// getCompletedMigrationByContextAndSQL checks if there exists a completed migration with exact same // context and SQL as given migration. If so, it returns its UUID. func (e *Executor) getCompletedMigrationByContextAndSQL(ctx context.Context, onlineDDL *schema.OnlineDDL) (completedUUID string, err error) { if onlineDDL.MigrationContext == "" { @@ -3210,7 +3210,7 @@ func (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.Onlin if exists { // table does exist, so this declarative DROP turns out to really be an actual DROP. No further action is needed here } else { - // table does not exist. We mark this DROP as implicitly sucessful + // table does not exist. We mark this DROP as implicitly successful _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, "no change") return nil @@ -3243,7 +3243,7 @@ func (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.Onlin return failMigration(err) } if diff == nil || diff.IsEmpty() { - // No diff! We mark this CREATE as implicitly sucessful + // No diff! We mark this CREATE as implicitly successful _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, "no change") return nil @@ -3507,7 +3507,7 @@ func (e *Executor) isVReplMigrationReadyToCutOver(ctx context.Context, onlineDDL } } { - // Both time_updated and transaction_timestamp must be in close priximity to each + // Both time_updated and transaction_timestamp must be in close proximity to each // other and to the time now, otherwise that means we're lagging and it's not a good time // to cut-over durationDiff := func(t1, t2 time.Time) time.Duration { @@ -3629,7 +3629,7 @@ func (e *Executor) reviewRunningMigrations(ctx context.Context) (countRunnning i // This VRepl migration may have started from outside this tablet, so // this executor may not own the migration _yet_. We make sure to own it. // VReplication migrations are unique in this respect: we are able to complete - // a vreplicaiton migration started by another tablet. + // a vreplication migration started by another tablet. e.ownedRunningMigrations.Store(uuid, onlineDDL) if lastVitessLivenessIndicator := migrationRow.AsInt64("vitess_liveness_indicator", 0); lastVitessLivenessIndicator < s.livenessTimeIndicator() { _ = e.updateMigrationTimestamp(ctx, "liveness_timestamp", uuid) @@ -3720,7 +3720,7 @@ func (e *Executor) reviewRunningMigrations(ctx context.Context) (countRunnning i countRunnning++ } { - // now, let's look at UUIDs we own and _think_ should be running, and see which of tham _isn't_ actually running or pending... + // now, let's look at UUIDs we own and _think_ should be running, and see which of them _isn't_ actually running or pending... uuidsFoundPending := map[string]bool{} for _, uuid := range pendingMigrationsUUIDs { uuidsFoundPending[uuid] = true @@ -3873,7 +3873,7 @@ func (e *Executor) gcArtifactTable(ctx context.Context, artifactTable, uuid stri // The fact we're here means the table is not needed anymore. We can throw it away. // We do so by renaming it into a GC table. We use the HOLD state and with a timestamp that is // in the past. So as we rename the table: - // - The Online DDL executor compeltely loses it and has no more access to its data + // - The Online DDL executor completely loses it and has no more access to its data // - TableGC will find it on next iteration, see that it's been on HOLD "long enough", and will // take it from there to transition it into PURGE or EVAC, or DROP, and eventually drop it. renameStatement, toTableName, err := schema.GenerateRenameStatementWithUUID(artifactTable, schema.HoldTableGCState, schema.OnlineDDLToGCUUID(uuid), t) @@ -4648,7 +4648,7 @@ func (e *Executor) submittedMigrationConflictsWithPendingMigrationInSingletonCon return true } -// submitCallbackIfNonConflicting is called internally by SubmitMigration, and is given a callack to execute +// submitCallbackIfNonConflicting is called internally by SubmitMigration, and is given a callback to execute // if the given migration does not conflict any terms. Specifically, this function looks for singleton or // singleton-context conflicts. // The call back can be an insertion of a new migration, or a retry of an existing migration, or whatnot. @@ -4754,10 +4754,10 @@ func (e *Executor) SubmitMigration( // So we will _mostly_ ignore the request: we will not submit a new migration. However, we will do // these things: - // 1. Check that the requested submmited migration macthes the existing one's migration-context, otherwise + // 1. Check that the requested submitted migration matches the existing one's migration-context, otherwise // this doesn't seem right, not the idempotency we were looking for if storedMigration.MigrationContext != onlineDDL.MigrationContext { - return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "migration rejected: found migration %s with different context: %s than submmitted migration's context: %s", onlineDDL.UUID, storedMigration.MigrationContext, onlineDDL.MigrationContext) + return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "migration rejected: found migration %s with different context: %s than submitted migration's context: %s", onlineDDL.UUID, storedMigration.MigrationContext, onlineDDL.MigrationContext) } // 2. Possibly, the existing migration is in 'failed' or 'cancelled' state, in which case this // resubmission should retry the migration. diff --git a/go/vt/vttablet/onlineddl/vrepl.go b/go/vt/vttablet/onlineddl/vrepl.go index b1dd0ff862..7934aed6af 100644 --- a/go/vt/vttablet/onlineddl/vrepl.go +++ b/go/vt/vttablet/onlineddl/vrepl.go @@ -168,7 +168,7 @@ func NewVRepl(workflow string, } } -// readAutoIncrement reads the AUTO_INCREMENT vlaue, if any, for a give ntable +// readAutoIncrement reads the AUTO_INCREMENT value, if any, for a give ntable func (v *VRepl) readAutoIncrement(ctx context.Context, conn *dbconnpool.DBConnection, tableName string) (autoIncrement uint64, err error) { query, err := sqlparser.ParseAndBind(sqlGetAutoIncrement, sqltypes.StringBindVariable(v.dbName), @@ -642,7 +642,7 @@ func (v *VRepl) analyze(ctx context.Context, conn *dbconnpool.DBConnection) erro return nil } -// generateInsertStatement generates the INSERT INTO _vt.replication stataement that creates the vreplication workflow +// generateInsertStatement generates the INSERT INTO _vt.replication statement that creates the vreplication workflow func (v *VRepl) generateInsertStatement(ctx context.Context) (string, error) { ig := vreplication.NewInsertGenerator(binlogdatapb.VReplicationWorkflowState_Stopped, v.dbName) ig.AddRow(v.workflow, v.bls, v.pos, "", "in_order:REPLICA,PRIMARY", diff --git a/go/vt/vttablet/onlineddl/vrepl/parser.go b/go/vt/vttablet/onlineddl/vrepl/parser.go index 87f82cb809..f1f2f1378d 100644 --- a/go/vt/vttablet/onlineddl/vrepl/parser.go +++ b/go/vt/vttablet/onlineddl/vrepl/parser.go @@ -112,7 +112,7 @@ func (p *AlterTableParser) DroppedColumnsMap() map[string]bool { return p.droppedColumns } -// IsRenameTable returns true when the ALTER TABLE statement inclusdes renaming the table +// IsRenameTable returns true when the ALTER TABLE statement includes renaming the table func (p *AlterTableParser) IsRenameTable() bool { return p.isRenameTable } diff --git a/go/vt/vttablet/onlineddl/vrepl/types.go b/go/vt/vttablet/onlineddl/vrepl/types.go index e4ddff6d58..0ca834ffdf 100644 --- a/go/vt/vttablet/onlineddl/vrepl/types.go +++ b/go/vt/vttablet/onlineddl/vrepl/types.go @@ -207,7 +207,7 @@ func (l *ColumnList) Equals(other *ColumnList) bool { return reflect.DeepEqual(l.Columns, other.Columns) } -// EqualsByNames chcks if the names in this list equals the names of another list, in order. Type is ignored. +// EqualsByNames checks if the names in this list equals the names of another list, in order. Type is ignored. func (l *ColumnList) EqualsByNames(other *ColumnList) bool { return reflect.DeepEqual(l.Names(), other.Names()) } @@ -252,7 +252,7 @@ func (l *ColumnList) MappedNamesColumnList(columnNamesMap map[string]string) *Co return NewColumnList(names) } -// SetEnumToTextConversion tells this column list that an enum is conveted to text +// SetEnumToTextConversion tells this column list that an enum is converted to text func (l *ColumnList) SetEnumToTextConversion(columnName string, enumValues string) { l.GetColumn(columnName).EnumToTextConversion = true l.GetColumn(columnName).EnumValues = enumValues diff --git a/go/vt/vttablet/sandboxconn/sandboxconn.go b/go/vt/vttablet/sandboxconn/sandboxconn.go index 0c8485f97e..55a635984e 100644 --- a/go/vt/vttablet/sandboxconn/sandboxconn.go +++ b/go/vt/vttablet/sandboxconn/sandboxconn.go @@ -391,7 +391,7 @@ func (sbc *SandboxConn) ConcludeTransaction(ctx context.Context, target *querypb return sbc.getError() } -// ReadTransaction returns the metadata for the sepcified dtid. +// ReadTransaction returns the metadata for the specified dtid. func (sbc *SandboxConn) ReadTransaction(ctx context.Context, target *querypb.Target, dtid string) (metadata *querypb.TransactionMetadata, err error) { sbc.ReadTransactionCount.Add(1) if err := sbc.getError(); err != nil { diff --git a/go/vt/vttablet/tabletconntest/fakequeryservice.go b/go/vt/vttablet/tabletconntest/fakequeryservice.go index cfe540ead4..d3adff022e 100644 --- a/go/vt/vttablet/tabletconntest/fakequeryservice.go +++ b/go/vt/vttablet/tabletconntest/fakequeryservice.go @@ -173,7 +173,7 @@ func (f *FakeQueryService) Commit(ctx context.Context, target *querypb.Target, t return 0, nil } -// rollbackTransactionID is a test transactin id for Rollback. +// rollbackTransactionID is a test transaction id for Rollback. const rollbackTransactionID int64 = 999044 // Rollback is part of the queryservice.QueryService interface diff --git a/go/vt/vttablet/tabletmanager/restore.go b/go/vt/vttablet/tabletmanager/restore.go index 4512b546f2..032b7357d4 100644 --- a/go/vt/vttablet/tabletmanager/restore.go +++ b/go/vt/vttablet/tabletmanager/restore.go @@ -581,7 +581,7 @@ func (tm *TabletManager) catchupToGTID(ctx context.Context, afterGTIDPos string, } } -// disableReplication stopes and resets replication on the mysql server. It moreover sets impossible replication +// disableReplication stops and resets replication on the mysql server. It moreover sets impossible replication // source params, so that the replica can't possibly reconnect. It would take a `CHANGE [MASTER|REPLICATION SOURCE] TO ...` to // make the mysql server replicate again (available via tm.MysqlDaemon.SetReplicationPosition) func (tm *TabletManager) disableReplication(ctx context.Context) error { diff --git a/go/vt/vttablet/tabletmanager/rpc_replication.go b/go/vt/vttablet/tabletmanager/rpc_replication.go index 9981219e4a..bec905e93c 100644 --- a/go/vt/vttablet/tabletmanager/rpc_replication.go +++ b/go/vt/vttablet/tabletmanager/rpc_replication.go @@ -418,7 +418,7 @@ func (tm *TabletManager) InitReplica(ctx context.Context, parent *topodatapb.Tab // DemotePrimary prepares a PRIMARY tablet to give up leadership to another tablet. // -// It attemps to idempotently ensure the following guarantees upon returning +// It attempts to idempotently ensure the following guarantees upon returning // successfully: // - No future writes will be accepted. // - No writes are in-flight. diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index b18caa1063..d81d2a6e6a 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -328,7 +328,7 @@ func (tm *TabletManager) UpdateVReplicationWorkflow(ctx context.Context, req *ta // VReplicationExec executes a vreplication command. func (tm *TabletManager) VReplicationExec(ctx context.Context, query string) (*querypb.QueryResult, error) { - // Replace any provided sidecar databsae qualifiers with the correct one. + // Replace any provided sidecar database qualifiers with the correct one. uq, err := sqlparser.ReplaceTableQualifiers(query, sidecar.DefaultName, sidecar.GetName()) if err != nil { return nil, err diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go index a471750da1..a70220a68f 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication_test.go @@ -993,7 +993,7 @@ func TestFailedMoveTablesCreateCleanup(t *testing.T) { ) // We expect the workflow creation to fail due to the invalid time - // zone and thus the workflow iteslf to be cleaned up. + // zone and thus the workflow itself to be cleaned up. tenv.tmc.setVReplicationExecResults(sourceTablet.tablet, fmt.Sprintf(deleteWorkflow, sourceKs, workflow.ReverseWorkflowName(wf)), &sqltypes.Result{RowsAffected: 1}, diff --git a/go/vt/vttablet/tabletmanager/tm_init.go b/go/vt/vttablet/tabletmanager/tm_init.go index 2cd21c09a2..2873c3a1d5 100644 --- a/go/vt/vttablet/tabletmanager/tm_init.go +++ b/go/vt/vttablet/tabletmanager/tm_init.go @@ -536,7 +536,7 @@ func (tm *TabletManager) createKeyspaceShard(ctx context.Context) (*topo.ShardIn tm._rebuildKeyspaceDone = make(chan struct{}) go tm.rebuildKeyspace(rebuildKsCtx, tm._rebuildKeyspaceDone, tablet.Keyspace, rebuildKeyspaceRetryInterval) default: - return nil, vterrors.Wrap(err, "initeKeyspaceShardTopo: failed to read SrvKeyspace") + return nil, vterrors.Wrap(err, "initKeyspaceShardTopo: failed to read SrvKeyspace") } // Rebuild vschema graph if this is the first tablet in this keyspace/cell. @@ -546,16 +546,16 @@ func (tm *TabletManager) createKeyspaceShard(ctx context.Context) (*topo.ShardIn // Check if vschema was rebuilt after the initial creation of the keyspace. if _, keyspaceExists := srvVSchema.GetKeyspaces()[tablet.Keyspace]; !keyspaceExists { if err := tm.TopoServer.RebuildSrvVSchema(ctx, []string{tm.tabletAlias.Cell}); err != nil { - return nil, vterrors.Wrap(err, "initeKeyspaceShardTopo: failed to RebuildSrvVSchema") + return nil, vterrors.Wrap(err, "initKeyspaceShardTopo: failed to RebuildSrvVSchema") } } case topo.IsErrType(err, topo.NoNode): // There is no SrvSchema in this cell at all, so we definitely need to rebuild. if err := tm.TopoServer.RebuildSrvVSchema(ctx, []string{tm.tabletAlias.Cell}); err != nil { - return nil, vterrors.Wrap(err, "initeKeyspaceShardTopo: failed to RebuildSrvVSchema") + return nil, vterrors.Wrap(err, "initKeyspaceShardTopo: failed to RebuildSrvVSchema") } default: - return nil, vterrors.Wrap(err, "initeKeyspaceShardTopo: failed to read SrvVSchema") + return nil, vterrors.Wrap(err, "initKeyspaceShardTopo: failed to read SrvVSchema") } return shardInfo, nil } diff --git a/go/vt/vttablet/tabletmanager/vdiff/engine.go b/go/vt/vttablet/tabletmanager/vdiff/engine.go index 72098eb52b..1ccf3dc80e 100644 --- a/go/vt/vttablet/tabletmanager/vdiff/engine.go +++ b/go/vt/vttablet/tabletmanager/vdiff/engine.go @@ -99,7 +99,7 @@ func NewTestEngine(ts *topo.Server, tablet *topodata.Tablet, dbn string, dbcf fu } func (vde *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) { - // If it's a test engine and we're already initilized then do nothing. + // If it's a test engine and we're already initialized then do nothing. if vde.fortests && vde.dbClientFactoryFiltered != nil && vde.dbClientFactoryDba != nil { return } @@ -153,7 +153,7 @@ func (vde *Engine) openLocked(ctx context.Context) error { return err } - // At this point we've fully and succesfully opened so begin + // At this point we've fully and successfully opened so begin // retrying error'd VDiffs until the engine is closed. vde.wg.Add(1) go func() { @@ -193,7 +193,7 @@ func (vde *Engine) retry(ctx context.Context, err error) { if err := vde.openLocked(ctx); err == nil { log.Infof("VDiff engine: opened successfully") // Don't invoke cancelRetry because openLocked - // will hold on to this context for later cancelation. + // will hold on to this context for later cancellation. vde.cancelRetry = nil vde.mu.Unlock() return diff --git a/go/vt/vttablet/tabletmanager/vdiff/engine_test.go b/go/vt/vttablet/tabletmanager/vdiff/engine_test.go index 75b0e37d63..0aedeec415 100644 --- a/go/vt/vttablet/tabletmanager/vdiff/engine_test.go +++ b/go/vt/vttablet/tabletmanager/vdiff/engine_test.go @@ -270,7 +270,7 @@ func TestEngineRetryErroredVDiffs(t *testing.T) { fmt.Sprintf("%s|%s|%s|%s||9223372036854775807|9223372036854775807||PRIMARY,REPLICA|1669511347|0|Running||%s|200||1669511347|1|0||1", id, vdiffenv.workflow, vreplSource, vdiffSourceGtid, vdiffDBName), ), nil) - // At this point we know that we kicked off the expected retry so we can short circit the vdiff. + // At this point we know that we kicked off the expected retry so we can short circuit the vdiff. shortCircuitTestAfterQuery(fmt.Sprintf("update _vt.vdiff set state = 'started', last_error = left('', 1024) , started_at = utc_timestamp() where id = %s", id), vdiffenv.dbClient) expectedControllerCnt++ diff --git a/go/vt/vttablet/tabletmanager/vreplication/controller.go b/go/vt/vttablet/tabletmanager/vreplication/controller.go index b9aad39fe6..d7a6f5a31b 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/controller.go +++ b/go/vt/vttablet/tabletmanager/vreplication/controller.go @@ -49,7 +49,7 @@ const ( ) // controller is created by Engine. Members are initialized upfront. -// There is no mutex within a controller becaust its members are +// There is no mutex within a controller because its members are // either read-only or self-synchronized. type controller struct { vre *Engine diff --git a/go/vt/vttablet/tabletmanager/vreplication/engine.go b/go/vt/vttablet/tabletmanager/vreplication/engine.go index 8b81dd722c..f230ecce04 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/engine.go +++ b/go/vt/vttablet/tabletmanager/vreplication/engine.go @@ -72,7 +72,7 @@ var waitRetryTime = 1 * time.Second // How frequently vcopier will update _vt.vreplication rows_copied var rowsCopiedUpdateInterval = 30 * time.Second -// How frequntly vcopier will garbage collect old copy_state rows. +// How frequently vcopier will garbage collect old copy_state rows. // By default, do it in between every 2nd and 3rd rows copied update. var copyStateGCInterval = (rowsCopiedUpdateInterval * 3) - (rowsCopiedUpdateInterval / 2) @@ -107,7 +107,7 @@ type Engine struct { throttlerClient *throttle.Client // This should only be set in Test Engines in order to short - // curcuit functions as needed in unit tests. It's automatically + // circuit functions as needed in unit tests. It's automatically // enabled in NewSimpleTestEngine. This should NOT be used in // production. shortcircuit bool @@ -143,7 +143,7 @@ func NewEngine(config *tabletenv.TabletConfig, ts *topo.Server, cell string, mys // InitDBConfig should be invoked after the db name is computed. func (vre *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) { - // If we're already initilized, it's a test engine. Ignore the call. + // If we're already initialized, it's a test engine. Ignore the call. if vre.dbClientFactoryFiltered != nil && vre.dbClientFactoryDba != nil { return } @@ -173,7 +173,7 @@ func NewTestEngine(ts *topo.Server, cell string, mysqld mysqlctl.MysqlDaemon, db } // NewSimpleTestEngine creates a new Engine for testing that can -// also short curcuit functions as needed. +// also short circuit functions as needed. func NewSimpleTestEngine(ts *topo.Server, cell string, mysqld mysqlctl.MysqlDaemon, dbClientFactoryFiltered func() binlogplayer.DBClient, dbClientFactoryDba func() binlogplayer.DBClient, dbname string, externalConfig map[string]*dbconfigs.DBConfigs) *Engine { vre := &Engine{ controllers: make(map[int32]*controller), @@ -262,7 +262,7 @@ func (vre *Engine) retry(ctx context.Context, err error) { } if err := vre.openLocked(ctx); err == nil { // Don't invoke cancelRetry because openLocked - // will hold on to this context for later cancelation. + // will hold on to this context for later cancellation. vre.cancelRetry = nil vre.mu.Unlock() return diff --git a/go/vt/vttablet/tabletmanager/vreplication/queryhistory/verifier.go b/go/vt/vttablet/tabletmanager/vreplication/queryhistory/verifier.go index a7015b0daf..ebe145461d 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/queryhistory/verifier.go +++ b/go/vt/vttablet/tabletmanager/vreplication/queryhistory/verifier.go @@ -41,7 +41,7 @@ func NewVerifier(sequence ExpectationSequence) *Verifier { } // AcceptQuery verifies that the provided query is valid according to the -// internal ExpectationSequence and the internal History of preceeding queries. +// internal ExpectationSequence and the internal History of preceding queries. // Returns a *Result indicating whether the query was accepted and, if not, // diagnostic details indicating why not. func (v *Verifier) AcceptQuery(query string) *Result { @@ -159,7 +159,7 @@ func (v *Verifier) checkQueryAgainstExpectation(query string, expectation Sequen // Query passed expectation. result.Accepted = true result.Matched = true - result.Message = "matched expectated query and expected order" + result.Message = "matched expected query and expected order" return true } diff --git a/go/vt/vttablet/tabletmanager/vreplication/vcopier.go b/go/vt/vttablet/tabletmanager/vreplication/vcopier.go index cbf524c54c..f88c900f2d 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vcopier.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vcopier.go @@ -612,7 +612,7 @@ func (vc *vcopier) copyTable(ctx context.Context, tableName string, copyState ma case result := <-resultCh: switch result.state { case vcopierCopyTaskCancel: - // A task cancelation probably indicates an expired context due + // A task cancellation probably indicates an expired context due // to a PlannedReparentShard or elapsed copy phase duration, // neither of which are error conditions. case vcopierCopyTaskComplete: @@ -1087,7 +1087,7 @@ func (vbc *vcopierCopyWorker) execute(ctx context.Context, task *vcopierCopyTask advanceFn = func(context.Context, *vcopierCopyTaskArgs) error { // Commit. if err := vbc.vdbClient.Commit(); err != nil { - return vterrors.Wrapf(err, "error commiting transaction") + return vterrors.Wrapf(err, "error committing transaction") } return nil } diff --git a/go/vt/vttablet/tabletmanager/vreplication/vcopier_test.go b/go/vt/vttablet/tabletmanager/vreplication/vcopier_test.go index 82a6d211b4..b960635ff1 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vcopier_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vcopier_test.go @@ -102,7 +102,7 @@ func testPlayerCopyCharPK(t *testing.T) { defer func() { vttablet.CopyPhaseDuration = savedCopyPhaseDuration }() savedWaitRetryTime := waitRetryTime - // waitRetry time should be very low to cause the wait loop to execute multipel times. + // waitRetry time should be very low to cause the wait loop to execute multiple times. waitRetryTime = 10 * time.Millisecond defer func() { waitRetryTime = savedWaitRetryTime }() @@ -332,7 +332,7 @@ func testPlayerCopyVarcharCompositePKCaseSensitiveCollation(t *testing.T) { defer func() { vttablet.CopyPhaseDuration = savedCopyPhaseDuration }() savedWaitRetryTime := waitRetryTime - // waitRetry time should be very low to cause the wait loop to execute multipel times. + // waitRetry time should be very low to cause the wait loop to execute multiple times. waitRetryTime = 10 * time.Millisecond defer func() { waitRetryTime = savedWaitRetryTime }() @@ -811,7 +811,7 @@ func testPlayerCopyWildcardRule(t *testing.T) { defer func() { vttablet.CopyPhaseDuration = savedCopyPhaseDuration }() savedWaitRetryTime := waitRetryTime - // waitRetry time should be very low to cause the wait loop to execute multipel times. + // waitRetry time should be very low to cause the wait loop to execute multiple times. waitRetryTime = 10 * time.Millisecond defer func() { waitRetryTime = savedWaitRetryTime }() @@ -979,7 +979,7 @@ func testPlayerCopyTableContinuation(t *testing.T) { "update src1 set id2=10 where id1=5", // move row from within to outside range. "update src1 set id1=12 where id1=6", - // move row from outside to witihn range. + // move row from outside to within range. "update src1 set id1=4 where id1=11", // modify the copied table. "update copied set val='bbb' where id=1", diff --git a/go/vt/vttablet/tabletmanager/vreplication/vplayer.go b/go/vt/vttablet/tabletmanager/vreplication/vplayer.go index 8eee211ff9..3abd24aa0e 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vplayer.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vplayer.go @@ -346,8 +346,8 @@ func (vp *vplayer) recordHeartbeat() error { // of transactions come in, with the last one being partial. In this case, all transactions // up to the last one have to be committed, and the final one must be partially applied. // -// Of the above events, the saveable ones are COMMIT, DDL, and OTHER. Eventhough -// A GTID comes as a separate event, it's not saveable until a subsequent saveable +// Of the above events, the saveable ones are COMMIT, DDL, and OTHER. Even though +// a GTID comes as a separate event, it's not saveable until a subsequent saveable // event occurs. VStreamer currently sequences the GTID to be sent just before // a saveable event, but we do not rely on this. To handle this, we only remember // the position when a GTID is encountered. The next saveable event causes the diff --git a/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go b/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go index e148151934..c4df7e618d 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vreplicator.go @@ -561,7 +561,7 @@ func (vr *vreplicator) setSQLMode(ctx context.Context, dbClient *vdbClient) (fun // - "vreplication" for most flows // - "vreplication:online-ddl" for online ddl flows. // Note that with such name, it's possible to throttle -// the worflow by either /throttler/throttle-app?app=vreplication and/or /throttler/throttle-app?app=online-ddl +// the workflow by either /throttler/throttle-app?app=vreplication and/or /throttler/throttle-app?app=online-ddl // This is useful when we want to throttle all migrations. We throttle "online-ddl" and that applies to both vreplication // migrations as well as gh-ost migrations. func (vr *vreplicator) throttlerAppName() string { @@ -1044,7 +1044,7 @@ func (vr *vreplicator) setExistingRowsCopied() { if vr.stats.CopyRowCount.Get() == 0 { rowsCopiedExisting, err := vr.readExistingRowsCopied(vr.id) if err != nil { - log.Warningf("Failed to read existing rows copied value for %s worfklow: %v", vr.WorkflowName, err) + log.Warningf("Failed to read existing rows copied value for %s workflow: %v", vr.WorkflowName, err) } else if rowsCopiedExisting != 0 { log.Infof("Resuming the %s vreplication workflow started on another tablet, setting rows copied counter to %v", vr.WorkflowName, rowsCopiedExisting) vr.stats.CopyRowCount.Set(rowsCopiedExisting) diff --git a/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go b/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go index 128d41d4bc..aaa4a97419 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/vreplicator_test.go @@ -339,7 +339,7 @@ func TestDeferSecondaryKeys(t *testing.T) { myvr.WorkflowType = int32(binlogdatapb.VReplicationWorkflowType_Reshard) // Insert second post copy action record to simulate a shard merge where you // have N controllers/replicators running for the same table on the tablet. - // This forces a second row, which would otherwise not get created beacause + // This forces a second row, which would otherwise not get created because // when this is called there's no secondary keys to stash anymore. addlAction, err := json.Marshal(PostCopyAction{ Type: PostCopyActionSQL, diff --git a/go/vt/vttablet/tabletserver/controller.go b/go/vt/vttablet/tabletserver/controller.go index ca4eeb8747..4d7e35862d 100644 --- a/go/vt/vttablet/tabletserver/controller.go +++ b/go/vt/vttablet/tabletserver/controller.go @@ -66,7 +66,7 @@ type Controller interface { // ClearQueryPlanCache clears internal query plan cache ClearQueryPlanCache() - // ReloadSchema makes the quey service reload its schema cache + // ReloadSchema makes the query service reload its schema cache ReloadSchema(ctx context.Context) error // RegisterQueryRuleSource adds a query rule source diff --git a/go/vt/vttablet/tabletserver/gc/tablegc.go b/go/vt/vttablet/tabletserver/gc/tablegc.go index 4947fd9c97..8658d7c3a3 100644 --- a/go/vt/vttablet/tabletserver/gc/tablegc.go +++ b/go/vt/vttablet/tabletserver/gc/tablegc.go @@ -65,7 +65,7 @@ func registerGCFlags(fs *pflag.FlagSet) { // purgeReentranceInterval marks the interval between searching tables to purge fs.DurationVar(&purgeReentranceInterval, "gc_purge_check_interval", purgeReentranceInterval, "Interval between purge discovery checks") // gcLifecycle is the sequence of steps the table goes through in the process of getting dropped - fs.StringVar(&gcLifecycle, "table_gc_lifecycle", gcLifecycle, "States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implcitly always included)") + fs.StringVar(&gcLifecycle, "table_gc_lifecycle", gcLifecycle, "States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implicitly always included)") } var ( @@ -120,7 +120,7 @@ type TableGC struct { lifecycleStates map[schema.TableGCState]bool } -// Status published some status valus from the collector +// Status published some status values from the collector type Status struct { Keyspace string Shard string @@ -575,7 +575,7 @@ func (collector *TableGC) transitionTable(ctx context.Context, transition *trans // when we transition into PURGE, that means we want to begin purging immediately // when we transition into DROP, that means we want to drop immediately - // Thereforce the default timestamp is Now + // Therefore the default timestamp is Now t := time.Now().UTC() switch transition.toGCState { case schema.EvacTableGCState: @@ -601,7 +601,7 @@ func (collector *TableGC) transitionTable(ctx context.Context, transition *trans return nil } -// addPurgingTable adds a table to the list of droppingpurging (or pending purging) tables +// addPurgingTable adds a table to the list of dropping purging (or pending purging) tables func (collector *TableGC) addPurgingTable(tableName string) (added bool) { if _, ok := collector.lifecycleStates[schema.PurgeTableGCState]; !ok { // PURGE is not a handled state. We don't want to purge this table or any other table, diff --git a/go/vt/vttablet/tabletserver/health_streamer.go b/go/vt/vttablet/tabletserver/health_streamer.go index 87c70a7133..2e75ccf2a2 100644 --- a/go/vt/vttablet/tabletserver/health_streamer.go +++ b/go/vt/vttablet/tabletserver/health_streamer.go @@ -50,8 +50,8 @@ import ( ) var ( - // blpFunc is a legaacy feature. - // TODO(sougou): remove after legacy resharding worflows are removed. + // blpFunc is a legacy feature. + // TODO(sougou): remove after legacy resharding workflows are removed. blpFunc = vreplication.StatusSummary errUnintialized = "tabletserver uninitialized" diff --git a/go/vt/vttablet/tabletserver/messager/message_manager.go b/go/vt/vttablet/tabletserver/messager/message_manager.go index 0629b31629..be2e0cf703 100644 --- a/go/vt/vttablet/tabletserver/messager/message_manager.go +++ b/go/vt/vttablet/tabletserver/messager/message_manager.go @@ -227,7 +227,7 @@ type messageManager struct { // wg is for ensuring all running goroutines have returned // before we can close the manager. You need to Add before - // launching any gorooutine while holding a lock on mu. + // launching any goroutine while holding a lock on mu. // The goroutine must in turn defer on Done. wg sync.WaitGroup @@ -272,7 +272,7 @@ func newMessageManager(tsv TabletService, vs VStreamer, table *schema.Table, pos } mm.readByPriorityAndTimeNext = sqlparser.BuildParsedQuery( // There should be a poller_idx defined on (time_acked, priority, time_next desc) - // for this to be as effecient as possible + // for this to be as efficient as possible "select priority, time_next, epoch, time_acked, %s from %v where time_acked is null and time_next < %a order by priority, time_next desc limit %a", columnList, mm.name, ":time_next", ":max") mm.ackQuery = sqlparser.BuildParsedQuery( diff --git a/go/vt/vttablet/tabletserver/messager/message_manager_test.go b/go/vt/vttablet/tabletserver/messager/message_manager_test.go index b8ca47ae46..5c5ab47d3c 100644 --- a/go/vt/vttablet/tabletserver/messager/message_manager_test.go +++ b/go/vt/vttablet/tabletserver/messager/message_manager_test.go @@ -317,7 +317,7 @@ func TestMessageManagerPostponeThrottle(t *testing.T) { // Postpone will wait on the unbuffered ch. <-r1.ch - // Set up a second subsriber, add a message. + // Set up a second subscriber, add a message. r2 := newTestReceiver(1) mm.Subscribe(context.Background(), r2.rcv) <-r2.ch diff --git a/go/vt/vttablet/tabletserver/planbuilder/testdata/exec_cases.txt b/go/vt/vttablet/tabletserver/planbuilder/testdata/exec_cases.txt index 5565f405bc..d5bd99ca7a 100644 --- a/go/vt/vttablet/tabletserver/planbuilder/testdata/exec_cases.txt +++ b/go/vt/vttablet/tabletserver/planbuilder/testdata/exec_cases.txt @@ -175,7 +175,7 @@ "NextCount": ":a" } -# squence with bad value +# sequence with bad value "select next 12345667852342342342323423423 values from seq" { "PlanID": "Nextval", diff --git a/go/vt/vttablet/tabletserver/query_engine.go b/go/vt/vttablet/tabletserver/query_engine.go index 7f83a29fc5..c31b65be8d 100644 --- a/go/vt/vttablet/tabletserver/query_engine.go +++ b/go/vt/vttablet/tabletserver/query_engine.go @@ -377,7 +377,7 @@ func (qe *QueryEngine) getPlan(curSchema *currentSchema, sql string) (*TabletPla return plan, errNoCache } -// GetPlan returns the TabletPlan that for the query. Plans are cached in a theine LRU cache. +// GetPlan returns the TabletPlan that for the query. Plans are cached in an LRU cache. func (qe *QueryEngine) GetPlan(ctx context.Context, logStats *tabletenv.LogStats, sql string, skipQueryPlanCache bool) (*TabletPlan, error) { span, _ := trace.NewSpan(ctx, "QueryEngine.GetPlan") defer span.Finish() @@ -424,7 +424,7 @@ func (qe *QueryEngine) getStreamPlan(curSchema *currentSchema, sql string) (*Tab return plan, errNoCache } -// GetStreamPlan returns the TabletPlan that for the query. Plans are cached in a theine LRU cache. +// GetStreamPlan returns the TabletPlan that for the query. Plans are cached in an LRU cache. func (qe *QueryEngine) GetStreamPlan(ctx context.Context, logStats *tabletenv.LogStats, sql string, skipQueryPlanCache bool) (*TabletPlan, error) { span, _ := trace.NewSpan(ctx, "QueryEngine.GetStreamPlan") defer span.Finish() diff --git a/go/vt/vttablet/tabletserver/query_executor_test.go b/go/vt/vttablet/tabletserver/query_executor_test.go index d4058df8ad..6ea3c90d98 100644 --- a/go/vt/vttablet/tabletserver/query_executor_test.go +++ b/go/vt/vttablet/tabletserver/query_executor_test.go @@ -71,7 +71,7 @@ func TestQueryExecutorPlans(t *testing.T) { input string // passThrough specifies if planbuilder.PassthroughDML must be set. passThrough bool - // dbResponses specifes the list of queries and responses to add to the fake db. + // dbResponses specifies the list of queries and responses to add to the fake db. dbResponses []dbResponse // resultWant is the result we want. resultWant *sqltypes.Result @@ -1729,7 +1729,7 @@ func TestQueryExecSchemaReloadCount(t *testing.T) { testcases := []struct { // input is the input query. input string - // dbResponses specifes the list of queries and responses to add to the fake db. + // dbResponses specifies the list of queries and responses to add to the fake db. dbResponses []dbResponse schemaReloadCount int }{{ diff --git a/go/vt/vttablet/tabletserver/repltracker/writer.go b/go/vt/vttablet/tabletserver/repltracker/writer.go index b13b78b59b..801fcc8cd5 100644 --- a/go/vt/vttablet/tabletserver/repltracker/writer.go +++ b/go/vt/vttablet/tabletserver/repltracker/writer.go @@ -92,7 +92,7 @@ func newHeartbeatWriter(env tabletenv.Env, alias *topodatapb.TabletAlias) *heart } if w.onDemandDuration > 0 { // see RequestHeartbeats() for use of onDemandRequestTicks - // it's basically a mechnism to rate limit operation RequestHeartbeats(). + // it's basically a mechanism to rate limit operation RequestHeartbeats(). // and selectively drop excessive requests. w.allowNextHeartbeatRequest() go func() { @@ -123,7 +123,7 @@ func (w *heartbeatWriter) Open() { if w.isOpen { return } - log.Info("Hearbeat Writer: opening") + log.Info("Heartbeat Writer: opening") // We cannot create the database and tables in this Open function // since, this is run when a tablet changes to Primary type. The other replicas @@ -159,7 +159,7 @@ func (w *heartbeatWriter) Close() { w.appPool.Close() w.allPrivsPool.Close() w.isOpen = false - log.Info("Hearbeat Writer: closed") + log.Info("Heartbeat Writer: closed") } // bindHeartbeatVars takes a heartbeat write (insert or update) and @@ -219,7 +219,7 @@ func (w *heartbeatWriter) recordError(err error) { writeErrors.Add(1) } -// enableWrites actives or deactives heartbeat writes +// enableWrites activates or deactivates heartbeat writes func (w *heartbeatWriter) enableWrites(enable bool) { if w.ticks == nil { return diff --git a/go/vt/vttablet/tabletserver/rules/map_test.go b/go/vt/vttablet/tabletserver/rules/map_test.go index 1e86b938a4..bd1030f119 100644 --- a/go/vt/vttablet/tabletserver/rules/map_test.go +++ b/go/vt/vttablet/tabletserver/rules/map_test.go @@ -136,7 +136,7 @@ func TestMapGetSetQueryRules(t *testing.T) { t.Errorf("Failed to set custom Rules: %s", err) } - // Test if we can successfully retrieve rules that've been set + // Test if we can successfully retrieve rules which been set qrs, err = qri.Get(denyListQueryRules) if err != nil { t.Errorf("GetRules failed to retrieve denyListQueryRules that has been set: %s", err) diff --git a/go/vt/vttablet/tabletserver/rules/rules.go b/go/vt/vttablet/tabletserver/rules/rules.go index c1e572caa2..4a7d128b95 100644 --- a/go/vt/vttablet/tabletserver/rules/rules.go +++ b/go/vt/vttablet/tabletserver/rules/rules.go @@ -563,7 +563,7 @@ func bvMatch(bvcond BindVarCond, bindVars map[string]*querypb.BindVariable) bool // ----------------------------------------------- // Support types for Rule -// Action speficies the list of actions to perform +// Action specifies the list of actions to perform // when a Rule is triggered. type Action int @@ -655,7 +655,7 @@ func init() { } } -// These are return statii. +// These are return states. const ( QROK = iota QRMismatch diff --git a/go/vt/vttablet/tabletserver/schema/engine_test.go b/go/vt/vttablet/tabletserver/schema/engine_test.go index 0a98a6ee67..9d55f654d4 100644 --- a/go/vt/vttablet/tabletserver/schema/engine_test.go +++ b/go/vt/vttablet/tabletserver/schema/engine_test.go @@ -565,7 +565,7 @@ func TestSchemaEngineCloseTickRace(t *testing.T) { } finished <- true }() - // Wait until the ticks are stopped or 2 seonds have expired. + // Wait until the ticks are stopped or 2 seconds have expired. select { case <-finished: return diff --git a/go/vt/vttablet/tabletserver/schema/schema.go b/go/vt/vttablet/tabletserver/schema/schema.go index 95c191392c..4b3d9c88fb 100644 --- a/go/vt/vttablet/tabletserver/schema/schema.go +++ b/go/vt/vttablet/tabletserver/schema/schema.go @@ -62,7 +62,7 @@ type Table struct { AllocatedSize uint64 } -// SequenceInfo contains info specific to sequence tabels. +// SequenceInfo contains info specific to sequence tables. // It must be locked before accessing the values inside. // If CurVal==LastVal, we have to cache new values. // When the schema is first loaded, the values are all 0, diff --git a/go/vt/vttablet/tabletserver/state_manager.go b/go/vt/vttablet/tabletserver/state_manager.go index 2115871c6b..7203174449 100644 --- a/go/vt/vttablet/tabletserver/state_manager.go +++ b/go/vt/vttablet/tabletserver/state_manager.go @@ -121,7 +121,7 @@ type stateManager struct { throttler lagThrottler tableGC tableGarbageCollector - // hcticks starts on initialiazation and runs forever. + // hcticks starts on initialization and runs forever. hcticks *timer.Timer // checkMySQLThrottler ensures that CheckMysql diff --git a/go/vt/vttablet/tabletserver/stream_consolidator.go b/go/vt/vttablet/tabletserver/stream_consolidator.go index 497c901104..9f720059dc 100644 --- a/go/vt/vttablet/tabletserver/stream_consolidator.go +++ b/go/vt/vttablet/tabletserver/stream_consolidator.go @@ -252,7 +252,7 @@ func (s *streamInFlight) update(result *sqltypes.Result, block bool, maxMemoryQu s.mu.Lock() defer s.mu.Unlock() - // if this stream can still be catched up with, we need to store the result in + // if this stream can still be caught up with, we need to store the result in // a catch up buffer; otherwise, we can skip this altogether and just fan out the result // to all the followers that are already caught up if s.catchupAllowed { diff --git a/go/vt/vttablet/tabletserver/tabletenv/env.go b/go/vt/vttablet/tabletserver/tabletenv/env.go index c7202080c4..6ae3813892 100644 --- a/go/vt/vttablet/tabletserver/tabletenv/env.go +++ b/go/vt/vttablet/tabletserver/tabletenv/env.go @@ -25,7 +25,7 @@ import ( ) // Env defines the functions supported by TabletServer -// that the sub-componennts need to access. +// that the sub-components need to access. type Env interface { CheckMySQL() Config() *TabletConfig diff --git a/go/vt/vttablet/tabletserver/tabletenv/seconds.go b/go/vt/vttablet/tabletserver/tabletenv/seconds.go index 205b571c9b..ae11121f2d 100644 --- a/go/vt/vttablet/tabletserver/tabletenv/seconds.go +++ b/go/vt/vttablet/tabletserver/tabletenv/seconds.go @@ -23,7 +23,7 @@ import ( ) // Seconds provides convenience functions for extracting -// duration from flaot64 seconds values. +// duration from float64 seconds values. type Seconds float64 // SecondsVar is like a flag.Float64Var, but it works for Seconds. diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index 25eb4da716..6c1a60928d 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -238,11 +238,11 @@ func (tsv *TabletServer) loadQueryTimeout() time.Duration { // onlineDDLExecutorToggleTableBuffer is called by onlineDDLExecutor as a callback function. onlineDDLExecutor // uses it to start/stop query buffering for a given table. -// It is onlineDDLExecutor's responsibility to make sure beffering is stopped after some definite amount of time. +// It is onlineDDLExecutor's responsibility to make sure buffering is stopped after some definite amount of time. // There are two layers to buffering/unbuffering: // 1. the creation and destruction of a QueryRuleSource. The existence of such source affects query plan rules // for all new queries (see Execute() function and call to GetPlan()) -// 2. affecting already existing rules: a Rule has a concext.WithCancel, that is cancelled by onlineDDLExecutor +// 2. affecting already existing rules: a Rule has a context.WithCancel, that is cancelled by onlineDDLExecutor func (tsv *TabletServer) onlineDDLExecutorToggleTableBuffer(bufferingCtx context.Context, tableName string, timeout time.Duration, bufferQueries bool) { queryRuleSource := fmt.Sprintf("onlineddl/%s", tableName) diff --git a/go/vt/vttablet/tabletserver/throttle/base/throttle_metric.go b/go/vt/vttablet/tabletserver/throttle/base/throttle_metric.go index ff6e1b146d..7070febb3b 100644 --- a/go/vt/vttablet/tabletserver/throttle/base/throttle_metric.go +++ b/go/vt/vttablet/tabletserver/throttle/base/throttle_metric.go @@ -30,7 +30,7 @@ var ErrNoSuchMetric = errors.New("No such metric") // ErrInvalidCheckType is an internal error indicating an unknown check type var ErrInvalidCheckType = errors.New("Unknown throttler check type") -// IsDialTCPError sees if th egiven error indicates a TCP issue +// IsDialTCPError sees if the given error indicates a TCP issue func IsDialTCPError(e error) bool { if e == nil { return false diff --git a/go/vt/vttablet/tabletserver/throttle/client.go b/go/vt/vttablet/tabletserver/throttle/client.go index 41888340b5..546d75c040 100644 --- a/go/vt/vttablet/tabletserver/throttle/client.go +++ b/go/vt/vttablet/tabletserver/throttle/client.go @@ -86,7 +86,7 @@ func NewBackgroundClient(throttler *Throttler, appName throttlerapp.Name, checkT // ThrottleCheckOK checks the throttler, and returns 'true' when the throttler is satisfied. // It does not sleep. // The function caches results for a brief amount of time, hence it's safe and efficient to -// be called very frequenty. +// be called very frequently. // The function is not thread safe. func (c *Client) ThrottleCheckOK(ctx context.Context, overrideAppName throttlerapp.Name) (throttleCheckOK bool) { if c == nil { @@ -117,7 +117,7 @@ func (c *Client) ThrottleCheckOK(ctx context.Context, overrideAppName throttlera } -// ThrottleCheckOKOrWait checks the throttler; if throttler is satisfied, the function returns 'true' mmediately, +// ThrottleCheckOKOrWait checks the throttler; if throttler is satisfied, the function returns 'true' immediately, // otherwise it briefly sleeps and returns 'false'. // Non-empty appName overrides the default appName. // The function is not thread safe. @@ -129,7 +129,7 @@ func (c *Client) ThrottleCheckOKOrWaitAppName(ctx context.Context, appName throt return ok } -// ThrottleCheckOKOrWait checks the throttler; if throttler is satisfied, the function returns 'true' mmediately, +// ThrottleCheckOKOrWait checks the throttler; if throttler is satisfied, the function returns 'true' immediately, // otherwise it briefly sleeps and returns 'false'. // The function is not thread safe. func (c *Client) ThrottleCheckOKOrWait(ctx context.Context) bool { diff --git a/go/vt/vttablet/tabletserver/throttle/mysql/mysql_throttle_metric.go b/go/vt/vttablet/tabletserver/throttle/mysql/mysql_throttle_metric.go index 8c8a5cc4b3..a7e3650f8f 100644 --- a/go/vt/vttablet/tabletserver/throttle/mysql/mysql_throttle_metric.go +++ b/go/vt/vttablet/tabletserver/throttle/mysql/mysql_throttle_metric.go @@ -20,9 +20,9 @@ import ( type MetricsQueryType int const ( - // MetricsQueryTypeDefault indictes the default, internal implementation. Specifically, our throttler runs a replication lag query + // MetricsQueryTypeDefault indicates the default, internal implementation. Specifically, our throttler runs a replication lag query MetricsQueryTypeDefault MetricsQueryType = iota - // MetricsQueryTypeShowGlobal indicatesa SHOW GLOBAL (STATUS|VARIABLES) query + // MetricsQueryTypeShowGlobal indicates SHOW GLOBAL (STATUS|VARIABLES) query MetricsQueryTypeShowGlobal // MetricsQueryTypeSelect indicates a custom SELECT query MetricsQueryTypeSelect diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index b8d84b1ed5..21f9b068d0 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -81,7 +81,7 @@ func init() { } func registerThrottlerFlags(fs *pflag.FlagSet) { - fs.StringVar(&throttleTabletTypes, "throttle_tablet_types", throttleTabletTypes, "Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' aways implicitly included") + fs.StringVar(&throttleTabletTypes, "throttle_tablet_types", throttleTabletTypes, "Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' always implicitly included") fs.Duration("throttle_threshold", 0, "Replication lag threshold for default lag throttling") fs.String("throttle_metrics_query", "", "Override default heartbeat/lag metric. Use either `SELECT` (must return single row, single value) or `SHOW GLOBAL ... LIKE ...` queries. Set -throttle_metrics_threshold respectively.") @@ -296,7 +296,7 @@ func (throttler *Throttler) readThrottlerConfig(ctx context.Context) (*topodatap return throttler.normalizeThrottlerConfig(srvks.ThrottlerConfig), nil } -// normalizeThrottlerConfig noramlizes missing throttler config information, as needed. +// normalizeThrottlerConfig normalizes missing throttler config information, as needed. func (throttler *Throttler) normalizeThrottlerConfig(throttlerConfig *topodatapb.ThrottlerConfig) *topodatapb.ThrottlerConfig { if throttlerConfig == nil { throttlerConfig = &topodatapb.ThrottlerConfig{} @@ -405,7 +405,7 @@ func (throttler *Throttler) Enable(ctx context.Context) bool { return true } -// Disable deactivates the probes and associated operations. When disabled, the throttler reponds to check +// Disable deactivates the probes and associated operations. When disabled, the throttler responds to check // queries with "200 OK" irrespective of lag or any other metrics. func (throttler *Throttler) Disable(ctx context.Context) bool { throttler.enableMutex.Lock() @@ -559,7 +559,7 @@ func (throttler *Throttler) readSelfMySQLThrottleMetric(ctx context.Context, pro switch metricsQueryType { case mysql.MetricsQueryTypeSelect: // We expect a single row, single column result. - // The "for" iteration below is just a way to get first result without knowning column name + // The "for" iteration below is just a way to get first result without knowing column name for k := range row { metric.Value, metric.Err = row.ToFloat64(k) } @@ -746,7 +746,7 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, // log.Errorf("error in GRPC call to tablet %v: %v", probe.Tablet.GetAlias(), gRPCErr) } } - // Backwards compatibility to v17: if the underlying tablets do not support CheckThrottler gRPC, attempt a HTTP cehck: + // Backwards compatibility to v17: if the underlying tablets do not support CheckThrottler gRPC, attempt a HTTP check: tabletCheckSelfURL := fmt.Sprintf("http://%s:%d/throttler/check-self?app=%s", probe.TabletHost, probe.TabletPort, throttlerapp.VitessName) resp, err := throttler.httpClient.Get(tabletCheckSelfURL) if err != nil { @@ -866,8 +866,8 @@ func (throttler *Throttler) refreshMySQLInventory(ctx context.Context) error { if !throttler.isLeader.Load() { // This tablet may have used to be the primary, but it isn't now. It may have a recollection // of previous clusters it used to probe. It may have recollection of specific probes for such clusters. - // This now ensures any existing cluster probes are overrridden with an empty list of probes. - // `clusterProbes` was created above as empty, and identificable via `clusterName`. This will in turn + // This now ensures any existing cluster probes are overridden with an empty list of probes. + // `clusterProbes` was created above as empty, and identifiable via `clusterName`. This will in turn // be used to overwrite throttler.mysqlInventory.ClustersProbes[clusterProbes.ClusterName] in // updateMySQLClusterProbes(). throttler.mysqlClusterProbesChan <- clusterProbes @@ -960,7 +960,7 @@ func (throttler *Throttler) expireThrottledApps() { } } -// ThrottleApp instructs the throttler to begin throttling an app, to som eperiod and with some ratio. +// ThrottleApp instructs the throttler to begin throttling an app, to some period and with some ratio. func (throttler *Throttler) ThrottleApp(appName string, expireAt time.Time, ratio float64, exempt bool) (appThrottle *base.AppThrottle) { throttler.throttledAppsMutex.Lock() defer throttler.throttledAppsMutex.Unlock() diff --git a/go/vt/vttablet/tabletserver/throttle/throttler_test.go b/go/vt/vttablet/tabletserver/throttle/throttler_test.go index c47466df52..e1a9c5abc7 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler_test.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler_test.go @@ -153,7 +153,7 @@ func TestRefreshMySQLInventory(t *testing.T) { validateClusterProbes := func(t *testing.T, ctx context.Context) { testName := fmt.Sprintf("leader=%t", throttler.isLeader.Load()) t.Run(testName, func(t *testing.T) { - // validateProbesCount expectes number of probes according to cluster name and throttler's leadership status + // validateProbesCount expects a number of probes according to cluster name and throttler's leadership status validateProbesCount := func(t *testing.T, clusterName string, probes *mysql.Probes) { if clusterName == selfStoreName { assert.Equal(t, 1, len(*probes)) diff --git a/go/vt/vttablet/tabletserver/throttle/throttlerapp/app.go b/go/vt/vttablet/tabletserver/throttle/throttlerapp/app.go index cc86ad0620..4f1f585783 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttlerapp/app.go +++ b/go/vt/vttablet/tabletserver/throttle/throttlerapp/app.go @@ -73,7 +73,7 @@ var ( ) // ExemptFromChecks returns 'true' for apps that should skip the throttler checks. The throttler should -// always repsond with automated "OK" to those apps, without delay. These apps also do not cause a heartbeat renewal. +// always respond with automated "OK" to those apps, without delay. These apps also do not cause a heartbeat renewal. func ExemptFromChecks(appName string) bool { return exemptFromChecks[appName] } diff --git a/go/vt/vttablet/tabletserver/tx_executor.go b/go/vt/vttablet/tabletserver/tx_executor.go index 9dc92506e8..93d18a200f 100644 --- a/go/vt/vttablet/tabletserver/tx_executor.go +++ b/go/vt/vttablet/tabletserver/tx_executor.go @@ -235,7 +235,7 @@ func (txe *TxExecutor) ConcludeTransaction(dtid string) error { }) } -// ReadTransaction returns the metadata for the sepcified dtid. +// ReadTransaction returns the metadata for the specified dtid. func (txe *TxExecutor) ReadTransaction(dtid string) (*querypb.TransactionMetadata, error) { if !txe.te.twopcEnabled { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "2pc is not enabled") diff --git a/go/vt/vttablet/tabletserver/txlimiter/tx_limiter_test.go b/go/vt/vttablet/tabletserver/txlimiter/tx_limiter_test.go index 3a4133b54d..f41f4a9089 100644 --- a/go/vt/vttablet/tabletserver/txlimiter/tx_limiter_test.go +++ b/go/vt/vttablet/tabletserver/txlimiter/tx_limiter_test.go @@ -117,7 +117,7 @@ func TestTxLimiter_LimitsOnlyOffendingUser(t *testing.T) { t.Errorf("Get(im1, ef1) after releasing: got %v, want %v", got, want) } - // Rejection coutner for user 1 should still be 1. + // Rejection count for user 1 should still be 1. if got, want := limiter.rejections.Counts()[key1], int64(1); got != want { t.Errorf("Rejections count for %s: got %d, want %d", key1, got, want) } diff --git a/go/vt/vttablet/tabletserver/txserializer/tx_serializer.go b/go/vt/vttablet/tabletserver/txserializer/tx_serializer.go index ec1ab47758..4a9124345a 100644 --- a/go/vt/vttablet/tabletserver/txserializer/tx_serializer.go +++ b/go/vt/vttablet/tabletserver/txserializer/tx_serializer.go @@ -51,7 +51,7 @@ import ( // - Waiting transactions are unblocked if their context is done. // - Both the local queue (per row range) and global queue (whole process) are // limited to avoid that queued transactions can consume the full capacity -// of vttablet. This is important if the capaciy is finite. For example, the +// of vttablet. This is important if the capacity is finite. For example, the // number of RPCs in flight could be limited by the RPC subsystem. type TxSerializer struct { env tabletenv.Env @@ -151,7 +151,7 @@ func (txs *TxSerializer) Wait(ctx context.Context, key, table string) (done Done if err != nil { if waited { // Waiting failed early e.g. due a canceled context and we did NOT get the - // slot. Call "done" now because we don'txs return it to the caller. + // slot. Call "done" now because we do not return it to the caller. txs.unlockLocked(key, false /* returnSlot */) } return nil, waited, err diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go index 92976bbedf..4ac2e79d38 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go @@ -7,7 +7,7 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreedto in writing, software +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go index 268a37437d..64c35f6ea9 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler_test.go @@ -7,7 +7,7 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreedto in writing, software +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and diff --git a/go/vt/vttablet/tabletserver/vstreamer/rowstreamer.go b/go/vt/vttablet/tabletserver/vstreamer/rowstreamer.go index bd25986498..99ebbbdfaa 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/rowstreamer.go +++ b/go/vt/vttablet/tabletserver/vstreamer/rowstreamer.go @@ -165,7 +165,7 @@ func (rs *rowStreamer) buildPlan() error { // "puncture"; this is an event that is captured by vstreamer. The completion of the flow fixes the // puncture, and places a new table under the original table's name, but the way it is done does not // cause vstreamer to refresh schema state. - // There is therefore a reproducable valid sequence of events where vstreamer thinks a table does not + // There is therefore a reproducible valid sequence of events where vstreamer thinks a table does not // exist, where it in fact does exist. // For this reason we give vstreamer a "second chance" to review the up-to-date state of the schema. // In the future, we will reduce this operation to reading a single table rather than the entire schema. diff --git a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go index 5c9885ee82..db5794646d 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go +++ b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go @@ -81,7 +81,7 @@ func (conn *snapshotConn) streamWithSnapshot(ctx context.Context, table, query s // Rotating the log when it's above a certain size ensures that we are processing // a relatively small binary log that will be minimal in size and GTID events. // We only attempt to rotate it if the current log is of any significant size to - // avoid too many unecessary rotations. + // avoid too many unnecessary rotations. if rotatedLog, err = conn.limitOpenBinlogSize(); err != nil { // This is a best effort operation meant to lower overhead and improve performance. // Thus it should not be required, nor cause the operation to fail. @@ -172,7 +172,7 @@ func (conn *snapshotConn) startSnapshotWithConsistentGTID(ctx context.Context) ( return replication.EncodePosition(mpos), nil } -// Close rollsback any open transactions and closes the connection. +// Close rolls back any open transactions and closes the connection. func (conn *snapshotConn) Close() { _, _ = conn.ExecuteFetch("rollback", 1, false) conn.Conn.Close() diff --git a/go/vt/vttablet/tabletserver/vstreamer/vstreamer.go b/go/vt/vttablet/tabletserver/vstreamer/vstreamer.go index f210e756da..d8a364d1ae 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/vstreamer.go +++ b/go/vt/vttablet/tabletserver/vstreamer/vstreamer.go @@ -211,7 +211,7 @@ func (vs *vstreamer) parseEvents(ctx context.Context, events <-chan mysql.Binlog // GTID->DDL // GTID->OTHER // HEARTBEAT is issued if there's inactivity, which is likely - // to heppend between one group of events and another. + // to happen between one group of events and another. // // Buffering only takes row or statement lengths into consideration. // Length of other events is considered negligible. diff --git a/go/vt/wrangler/schema.go b/go/vt/wrangler/schema.go index e6c1fbc25d..ae24106c97 100644 --- a/go/vt/wrangler/schema.go +++ b/go/vt/wrangler/schema.go @@ -262,7 +262,7 @@ func (wr *Wrangler) CopySchemaShard(ctx context.Context, sourceTabletAlias *topo } } - // Notify Replicass to reload schema. This is best-effort. + // Notify Replicas to reload schema. This is best-effort. reloadCtx, cancel := context.WithTimeout(ctx, waitReplicasTimeout) defer cancel() resp, err := wr.VtctldServer().ReloadSchemaShard(reloadCtx, &vtctldatapb.ReloadSchemaShardRequest{ diff --git a/go/vt/wrangler/testlib/vtctl_pipe.go b/go/vt/wrangler/testlib/vtctl_pipe.go index 38c535f005..448f248821 100644 --- a/go/vt/wrangler/testlib/vtctl_pipe.go +++ b/go/vt/wrangler/testlib/vtctl_pipe.go @@ -138,7 +138,7 @@ func (vp *VtctlPipe) run(args []string, outputFunc func(string)) error { } // RunAndStreamOutput returns the output of the vtctl command as a channel. -// When the channcel is closed, the command did finish. +// When the channel is closed, the command did finish. func (vp *VtctlPipe) RunAndStreamOutput(args []string) (logutil.EventStream, error) { actionTimeout := 30 * time.Second ctx := context.Background() diff --git a/go/vt/wrangler/traffic_switcher_env_test.go b/go/vt/wrangler/traffic_switcher_env_test.go index c8ec71dba9..572b2b4a9e 100644 --- a/go/vt/wrangler/traffic_switcher_env_test.go +++ b/go/vt/wrangler/traffic_switcher_env_test.go @@ -373,7 +373,7 @@ func newTestTableMigraterCustom(ctx context.Context, t *testing.T, sourceShards, } // newTestTablePartialMigrater creates a test tablet migrater -// specifially for partial or shard by shard migrations. +// specifically for partial or shard by shard migrations. // The shards must be the same on the source and target, and we // must be moving a subset of them. // fmtQuery should be of the form: 'select a, b %s group by a'. diff --git a/go/vt/wrangler/traffic_switcher_test.go b/go/vt/wrangler/traffic_switcher_test.go index 6c97758ad4..f7aebed185 100644 --- a/go/vt/wrangler/traffic_switcher_test.go +++ b/go/vt/wrangler/traffic_switcher_test.go @@ -286,7 +286,7 @@ func TestTableMigrateMainflow(t *testing.T) { verifyQueries(t, tme.allDBClients) //------------------------------------------------------------------------------------------------------------------- - // Test SwitchWrites cancelation on failure. + // Test SwitchWrites cancellation on failure. tme.expectNoPreviousJournals() // Switch all the reads first. @@ -607,7 +607,7 @@ func TestShardMigrateMainflow(t *testing.T) { verifyQueries(t, tme.allDBClients) //------------------------------------------------------------------------------------------------------------------- - // Test SwitchWrites cancelation on failure. + // Test SwitchWrites cancellation on failure. tme.expectNoPreviousJournals() // Switch all the reads first. diff --git a/go/vt/wrangler/vdiff.go b/go/vt/wrangler/vdiff.go index 3084eba0e2..5de1a4b1d3 100644 --- a/go/vt/wrangler/vdiff.go +++ b/go/vt/wrangler/vdiff.go @@ -528,7 +528,7 @@ func findPKs(table *tabletmanagerdatapb.TableDefinition, targetSelect *sqlparser } // getColumnCollations determines the proper collation to use for each -// column in the table definition leveraging MySQL's collation inheritence +// column in the table definition leveraging MySQL's collation inheritance // rules. func getColumnCollations(table *tabletmanagerdatapb.TableDefinition) (map[string]collations.ID, error) { collationEnv := collations.Local() @@ -547,7 +547,7 @@ func getColumnCollations(table *tabletmanagerdatapb.TableDefinition) (map[string tableCharset := tableschema.GetCharset() tableCollation := tableschema.GetCollation() // If no explicit collation is specified for the column then we need - // to walk the inheritence tree. + // to walk the inheritance tree. getColumnCollation := func(column *sqlparser.ColumnDefinition) collations.ID { // If there's an explicit collation listed then use that. if column.Type.Options.Collate != "" { @@ -568,7 +568,7 @@ func getColumnCollations(table *tabletmanagerdatapb.TableDefinition) (map[string return collationEnv.DefaultCollationForCharset(strings.ToLower(tableCharset)) } // The table is using the global default charset and collation and - // we inherite that. + // we inherit that. return collations.Default() } @@ -996,7 +996,7 @@ func (df *vdiff) streamOne(ctx context.Context, keyspace, shard string, particip }() } -// syncTargets fast-forwards the vreplication to the source snapshot positons +// syncTargets fast-forwards the vreplication to the source snapshot positions // and waits for the selected tablets to catch up to that point. func (df *vdiff) syncTargets(ctx context.Context, filteredReplicationWaitTime time.Duration) error { waitCtx, cancel := context.WithTimeout(ctx, filteredReplicationWaitTime) diff --git a/go/vt/wrangler/vexec.go b/go/vt/wrangler/vexec.go index 0734fa7b59..7cad9a5f31 100644 --- a/go/vt/wrangler/vexec.go +++ b/go/vt/wrangler/vexec.go @@ -761,7 +761,7 @@ func (wr *Wrangler) getStreams(ctx context.Context, workflow, keyspace string) ( // Note: this is done here only because golang does // not currently support setting json tags in proto // declarations so that I could request it always be - // ommitted from marshalled JSON output: + // omitted from marshalled JSON output: // https://github.com/golang/protobuf/issues/52 status.Bls.OnDdl = 0 }