Skip to content

v1.20.0

Choose a tag to compare

@Tusamarco Tusamarco released this 21 Jun 17:32
925f20c

Code quality and correctness fixes across server, configurator, and documentation

  • Code quality and correctness fixes across server, configurator, and documentation
    server.go — request body reading
  • Replace make([]byte, ContentLength) + Read() with io.ReadAll(), which handles
    chunked transfer encoding (ContentLength = -1) and guarantees a full read.
  • Check and surface read errors instead of silently discarding them.
  • Add post-read empty-body guard for the case where ContentLength is nonzero
    but the body arrives empty.
  • Change ContentLength <= 0 guard to == 0 so chunked requests are no longer
    rejected before the body is read.
    configurator.go — buffer pool calculation bug (GR)
  • paramInnoDBBufferPool: bufferPoolSubstract was hardcoded to InnoDBPctValuePXC
    (0.80) even for Group Replication deployments. Now uses bufferPollPct, which
    is correctly set to InnoDBPctValueGR (0.70) for GR. This prevented the GCS
    cache from getting its reserved memory in GR configurations.
    configurator.go — negative buffer pool floor
  • In the negative-leftover branch of paramInnoDBBufferPool, add a minimum floor
    (MinLimitPXC or MinLimitGR of total MySQL memory) so the buffer pool cannot
    shrink below the saturation threshold when allocations exceed available memory.
    configurator.go — load-type switch refactoring
  • Add loadValues([4]string) and loadFloat([4]float64) helpers: single-switch
    dispatchers indexed [MostlyReads, SomeWrites, EqualReadsWrites, HeavyWrites].
  • Replace 8 repeated switch-on-loadID blocks with calls to these helpers:
    getGcache footprint factor, calculateTmpTableFootprint multiplier,
    getGcacheLoad, paramBinlogCacheSize, paramJoinBuffer, paramReadRndBuffer,
    paramSortBuffer, paramInnoDBIOCapacityMax.
  • Adding a new load type now requires changes in two helpers only, not 15 sites.
  • getGcache previously used raw integer literals (case 1/2/3) instead of the
    LoadType* constants; now uses the named constants via loadFloat.
    mysqloperatorcalculator.go — consolidate duplicate request resolution
  • Remove standalone getConfForConfRequest() function; route all calls through
    the exported GetConfForConfRequest() method, eliminating the dual-path logic.
    Constants.go — extract constants to dedicated file
  • Move all package-level constants out of Configuration.go into Constants.go
    to separate data structure definitions from tuning values.
    README.md — fix output format documentation
  • Remove "default", "min", "max" fields from the JSON example snippet: the
    custom MarshalJSON on Parameter only emits "name" and "value"; the README
    was documenting fields that are never actually present in the response.
  • Remove the claim that the human-readable format strips min/max/default
    (those fields were never in the JSON output to begin with).
  • Add unit tests