Skip to content
Jan Ciołek edited this page Nov 28, 2022 · 1 revision

How to backport a patch

Here are the instructions on how to backport some changes to an older version of Scylla.
It's the easiest to show it by an example, so let's look at PR #12031, which fixed issue #12014.

Wait for the original change to get merged

First the original PR should get merged. In the example the author wanted to merge the branch cvybhu:filter_multi_bug into scylladb:master. Each PR is submitted on its own branch, which the PR author wants to merge into the master branch. Before the changes end up on master, they are first added to the next branch to run some additional tests. Later the next branch becomes master and the PR is officialy merged.

A backport PR

Released versions of Scylla live on their own branches - branch-5.0, branch-4.6 etc. To backport the change we will have to put it on its own branch and merge it into the branch with the desired version. In the example, the PR with the backport #12086 wants to merge cvybhu:filter_multi_bug_5.0 into scylladb:branch-5.0. Before the changes end up on branch-5.0, they are first added to the next-5.0 branch to run some additional tests. Later the next-5.0 branch becomes branch-5.0 and the PR is officially backported.

Preparing the backport PR

  1. Go to the branch with the target backport version
git fetch origin branch-5.0
git checkout -t origin/branch-5.0
git submodule sync
git submodule update --recursive
  1. Create a branch with the fix
git checkout -b my_fix_branch_5.0
  1. Copy the changes to the branch, use the merge commit from master
git cherry-pick -m1 -x 2d2034ea28b8615a130146ad9780010d29d2fcc9

Resolve conflicts as necessary

  1. Build and run the tests using dbuild
./tools/toolchain/dbuild ./configure.py --disable-dpdk
./tools/toolchain/dbuild ninja dev-test
  1. Push the branch
git push <my-scylla-fork> my_fix_branch_5.0
  1. Open the PR.
    Change the branch so that the merge target is the backport branch (e.g branch-5.0) instead of master
Clone this wiki locally