Backport rebase common ancestor schema (#10207)