From 9aa8536a3f9a7183824d8410fe7491ecc9c18307 Mon Sep 17 00:00:00 2001 From: Oleg Afanasyev Date: Wed, 22 Mar 2023 20:45:13 +0000 Subject: [PATCH] roachprod: change scp flags to avoid copy via local host Previously default scp option made it to copy files via local host. This was causing unnecessary delays and network usage because files were first copied to one node, then distributed from that node using scp between remote locations. Unfortunately the default scp behaviour is to fetch from src and put to dst to avoid authenticating from src to dst. This commit adds scp options to do direct copy. Fixes: #99103 Release note: None --- pkg/roachprod/install/cluster_synced.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/roachprod/install/cluster_synced.go b/pkg/roachprod/install/cluster_synced.go index 3a05621d1327..067699f7586a 100644 --- a/pkg/roachprod/install/cluster_synced.go +++ b/pkg/roachprod/install/cluster_synced.go @@ -2381,7 +2381,9 @@ func (c *SyncedCluster) SSH(ctx context.Context, l *logger.Logger, sshArgs, args // which we do want to be able to retry. func scp(src, dest string) (*RunResultDetails, error) { args := []string{ - "scp", "-r", "-C", + "scp", + // ssh to src then scp dsc mode, use agent forwarding, recursive, compression + "-R", "-A", "-r", "-C", "-o", "StrictHostKeyChecking=no", } args = append(args, sshAuthArgs()...)