Backporting
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.
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.
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.
- 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
- Create a branch with the fix
git checkout -b my_fix_branch_5.0
- Copy the changes to the branch, use the merge commit from
master
git cherry-pick -m1 -x 2d2034ea28b8615a130146ad9780010d29d2fcc9
Resolve conflicts as necessary
- Build and run the tests using
dbuild
./tools/toolchain/dbuild ./configure.py --disable-dpdk
./tools/toolchain/dbuild ninja dev-test
- Push the branch
git push <my-scylla-fork> my_fix_branch_5.0
- Open the PR.
Change the branch so that the merge target is the backport branch (e.gbranch-5.0
) instead ofmaster