turbostats: the database section, for dbhealth - #443
Merged
Merged
Conversation
wire.Database and its sub-types, as the spec (#441) defines them: probe, resources, tables, replication and the collection cost. A failed probe marshals probe alone; the field is optional on the bundle beside Pipeline and Serve. bundle.schema.json regenerated. Tests: the spec's example round-trips with the spec's field names; a failed probe carries no resources, tables or replication; a bundle with only a database section marshals it and omits it when nil.
…idest bundle TestWire_NoFieldScalesWithCardinality failed in CI: Database.Tables, Replication.Replicas and Collection.Errors are slices with no stated bound. None grows with the data in the database: tables are the operator's list, replicas are the cluster's topology, errors are one per table and one per catalog query. The contract now carries the caps, wire.MaxDatabaseTables 50, MaxDatabaseReplicas 16, MaxDatabaseErrors 60, and the shape guard exempts the three by name. TestCollect_AFullDatabaseBundleStaysUnderTheCeiling prices the widest bundle at those caps: 47725 bytes, under a 48 KiB ceiling. That is three times the 16 KiB a pipeline bundle's receiver allows, so the receiver that accepts database bundles needs 64 KiB; that lands with control's kind change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task 1 of the dbhealth v1 plan (turbolytics/dbhealth#1). Implements the section the spec (#441) defines.
wire.Databaseand its sub-types:DatabaseProbe,DatabaseResources,DatabaseConnections,DatabaseMemory,DatabaseTable,DatabaseReplication,DatabaseReplica,DatabaseCollection,DatabaseError.Bundle.Database, optional, besidePipelineandServe.bundle.schema.jsonregenerated (make schema).Tests: the spec's example round-trips with the spec's field names; a failed probe marshals
probealone; a bundle with only adatabasesection marshals it, and omits it when nil.turbostats/wireandinternal/schemapass under-race.Next: a release, so dbhealth can pin the module.
Second commit. CI's shape guard (
TestWire_NoFieldScalesWithCardinality) rejected the section's three lists. They are now bounded in the contract:wire.MaxDatabaseTables50,MaxDatabaseReplicas16,MaxDatabaseErrors60. The widest bundle at those caps is 47,725 bytes, under a 48 KiB ceiling, which means control's 16 KiB body limit has to become 64 KiB for database bundles. That change rides with control'sKindwork in a later PR.