This is a backport from branch-2 but we do not backport the test because it uses branch-2-isms. Signed-off-by: stack <stack@apache.org>