Skip to content

Sync from upstream 2026-06-08#51

Open
forge33 wants to merge 8 commits into
masterfrom
sync-upstream-20260608
Open

Sync from upstream 2026-06-08#51
forge33 wants to merge 8 commits into
masterfrom
sync-upstream-20260608

Conversation

@forge33

@forge33 forge33 commented Jun 8, 2026

Copy link
Copy Markdown

Description

Sync master from upstream github/gh-ost master.

Upstream commits brought in:

Conflict resolutions

  • go/base/context.go: kept Shopify's Metrics metrics.Emitter interface (Shopify is ahead of upstream's *metrics.Client).
  • go/metrics/client.go: kept Shopify's superset — Emitter interface + Histogram method.
  • go/sql/builder.go: accepted upstream's additional defensive guards (additive, complementary to Shopify's edd6e2b8 guards).
  • go/metrics/go_runtime.go + go_runtime_test.go: removed — upstream added these as separate files (from cherry-picking our PR Add Go runtime metrics to statsd reporting github/gh-ost#1690), but Shopify has since consolidated their contents into emit.go using the more specific MemStatsGaugeEmitter interface.

Verification

  • go build ./... — success
  • go test ./... — 212 passed in 7 packages

grodowski and others added 8 commits May 26, 2026 10:48
…github#1684)

* Fix resume data loss: route heartbeat coords through applyEventsQueue

onChangelogHeartbeatEvent was mutating applier.CurrentCoordinates directly
from the streamer goroutine, before any DML that preceded the heartbeat was
applied to the ghost table. The checkpoint loop reads CurrentCoordinates as
"applied through this GTID" and could persist a checkpoint whose
LastTrxCoords was ahead of what was actually applied.

If gh-ost crashed before applyEventsQueue drained, --resume read that
checkpoint and called StartSyncGTID with the persisted set; MySQL treated
the un-applied GTIDs as already-seen and never re-streamed them. The ghost
table silently lost those DMLs and cut-over produced a stale table.

Fix: enqueue a tableWriteFunc onto applyEventsQueue that performs the
coords bump. The apply goroutine executes it in order, after the DMLs the
streamer enqueued before the heartbeat, restoring the invariant.

Adds TestMigratorHeartbeatDoesNotAdvancePastUnappliedDML, which fails at
the previous HEAD and passes after the fix; also asserts queue ordering to
guard against future changes that wrap the heartbeat enqueue in a goroutine.

Co-authored-by: Bastian Bartmann <bastian.bartmann@shopify.com>

* Replace direct channel write with SendWithContext

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Bastian Bartmann <bastian.bartmann@shopify.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Add Datadog/statsd with simple client emitting startup

* Add go runtime metrics to statsd reporting

---------

Co-authored-by: meiji163 <meiji163@github.com>
Refactor newTestMigrationContext to set ServeSocketFile via os.TempDir() and remove runtime.Caller-based path derivation.
* Disable CGO for release builds

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…60608

# Conflicts:
#	go/base/context.go
#	go/metrics/client.go
#	go/sql/builder.go
@forge33 forge33 changed the title Sync from upstream github/gh-ost Sync from upstream 2026-06-08 Jun 8, 2026
@forge33 forge33 requested review from coding-chimp and grodowski June 8, 2026 18:41
@forge33 forge33 added the #gsd:50633 Data Storage: gh-ost Observability Instrumentation label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50633 Data Storage: gh-ost Observability Instrumentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants