diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3d252bc0..e6284864 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -9,7 +9,7 @@ jobs: github-pages: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@v6.0.2 - name: Build documentations run: .github/workflows/build-docs.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c6020dc..b05ebc8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,18 +14,18 @@ jobs: runner: [ubuntu-latest, shopify-ubuntu-arm64] runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@v6.0.2 - name: Setup Go - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + uses: actions/setup-go@v6.4.0 with: - go-version: 1.24.1 + go-version: "1.26.2" - name: Building Ghostferry run: .github/workflows/build-deb.sh - name: Upload debs - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@v7.0.1 with: name: debs-${{ github.sha }}-${{ matrix.runner }} path: build/ghostferry* @@ -34,9 +34,9 @@ jobs: runs-on: ubuntu-latest needs: build-debs steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@v6.0.2 - name: Fetch uploaded artifacts - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + uses: actions/download-artifact@v8.0.1 with: pattern: debs-${{ github.sha }}-* merge-multiple: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55120d18..39cde138 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,10 +29,10 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@v6.0.2 + - uses: actions/setup-go@v6.4.0 with: - go-version: 1.24.1 + go-version: "1.26.2" - name: Starting up MySQL run: .github/workflows/start-mysql.sh @@ -54,10 +54,10 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@v6.0.2 + - uses: actions/setup-go@v6.4.0 with: - go-version: 1.24.1 + go-version: "1.26.2" - name: Starting up MySQL run: .github/workflows/start-mysql.sh @@ -85,13 +85,12 @@ jobs: GHOSTFERRY_LOG_BACKEND: ${{ matrix.log_backend }} steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@v6.0.2 + - uses: actions/setup-go@v6.4.0 with: - go-version: 1.24.1 - - uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0 + go-version: "1.26.2" + - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2 bundler-cache: true - name: Starting up MySQL @@ -106,16 +105,16 @@ jobs: runner: [ubuntu-latest, shopify-ubuntu-arm64] runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + - uses: actions/checkout@v6.0.2 + - uses: actions/setup-go@v6.4.0 with: - go-version: 1.24.1 + go-version: "1.26.2" - name: Building Ghostferry run: .github/workflows/build-deb.sh --tagged-only - name: Upload debs - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@v7.0.1 with: name: debs-${{ github.sha }}-${{ matrix.runner }} path: build/ghostferry* diff --git a/.ruby-version b/.ruby-version index be94e6f5..7921bd0c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.4.8 diff --git a/CHANGELOG.md b/CHANGELOG.md index e6b903ef..42b47392 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file. - Align default zerolog log level with logrus (info vs trace) - Introduce slog handler wrapper around our Logger interface and use it with BinlogStreamer +- Updated golang to 1.26.2 +- Updated ruby to 3.4.8 (test dependency) +- Updated github actions (CI dependency) ### Removed diff --git a/Gemfile b/Gemfile index 2903d26b..2afad33c 100644 --- a/Gemfile +++ b/Gemfile @@ -16,3 +16,5 @@ group :development do gem "tqdm" gem "pry-byebug" end + +gem "mutex_m", "~> 0.3.0" diff --git a/Gemfile.lock b/Gemfile.lock index b881a877..e4c14075 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,34 +1,42 @@ GEM remote: https://rubygems.org/ specs: - ansi (1.5.0) - builder (3.2.4) - byebug (11.1.3) + ansi (1.6.0) + bigdecimal (4.1.1) + builder (3.3.0) + byebug (13.0.0) + reline (>= 0.6.0) coderay (1.1.3) - method_source (1.0.0) - minitest (5.20.0) + io-console (0.8.2) + method_source (1.1.0) + minitest (5.27.0) minitest-fail-fast (0.1.0) minitest (~> 5) - minitest-hooks (1.5.1) + minitest-hooks (1.5.3) minitest (> 5.3) - minitest-reporters (1.6.1) + minitest-reporters (1.8.0) ansi builder - minitest (>= 5.0) + minitest (>= 5.0, < 7) ruby-progressbar - minitest-retry (0.2.2) + minitest-retry (0.3.1) minitest (>= 5.0) - mysql2 (0.5.5) - pry (0.14.2) + mutex_m (0.3.0) + mysql2 (0.5.7) + bigdecimal + pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) - rake (13.2.1) + reline (>= 0.6.0) + pry-byebug (3.12.0) + byebug (~> 13.0) + pry (>= 0.13, < 0.17) + rake (13.4.1) + reline (0.6.3) + io-console (~> 0.5) ruby-progressbar (1.13.0) tqdm (0.4.1) - webrick (1.8.2) + webrick (1.9.2) PLATFORMS ruby @@ -39,6 +47,7 @@ DEPENDENCIES minitest-hooks minitest-reporters (~> 1.4) minitest-retry + mutex_m (~> 0.3.0) mysql2 pry-byebug rake @@ -46,4 +55,4 @@ DEPENDENCIES webrick BUNDLED WITH - 2.2.22 + 4.0.10 diff --git a/dev.yml b/dev.yml index af6fa2d5..bcfe6b9c 100644 --- a/dev.yml +++ b/dev.yml @@ -9,7 +9,7 @@ up: - ruby - bundler - go: - version: "1.24.1" + version: "1.26.2" - podman - custom: name: Go Dependencies diff --git a/go.mod b/go.mod index cc45d577..0dbdbfd0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/Shopify/ghostferry -go 1.24.1 +go 1.26.2 require ( github.com/DataDog/datadog-go v4.8.2+incompatible diff --git a/test/integration/interrupt_resume_test.rb b/test/integration/interrupt_resume_test.rb index 7540b227..6a6e9033 100644 --- a/test/integration/interrupt_resume_test.rb +++ b/test/integration/interrupt_resume_test.rb @@ -19,7 +19,11 @@ def test_interrupt_resume_without_writes_to_source_to_check_target_state_when_in result = target_db.query("SELECT COUNT(*) AS cnt FROM #{DEFAULT_FULL_TABLE_NAME}") count = result.first["cnt"] - assert_equal 200, count + # TERM is delivered asynchronously so the signal may arrive after the + # second batch has already been written. At least one batch (200 rows) + # must have been copied; more is also acceptable as we are verifying + # the last_successful_id later on against the dumped state. + assert_operator count, :>=, 200 result = target_db.query("SELECT MAX(id) AS max_id FROM #{DEFAULT_FULL_TABLE_NAME}") last_successful_id = result.first["max_id"] @@ -701,7 +705,10 @@ def test_interrupt_resume_without_writes_to_source_with_uuid_table result = target_db.query("SELECT COUNT(*) AS cnt FROM #{UUID_FULL_TABLE_NAME}") count = result.first["cnt"] - assert_equal 200, count + # Same as the integer-keyed variant: TERM is async so at least one batch + # (200 rows) must be copied; a second batch landing first is also valid. + # We are verifying the last_successful_id_bytes later on against the dumped state. + assert_operator count, :>=, 200 result = target_db.query("SELECT MAX(uuid) AS max_id FROM #{UUID_FULL_TABLE_NAME}") last_successful_id_bytes = result.first["max_id"]