tidy up: remove extra cloud sync attempts

Summary:
tidy up: remove extra cloud sync attempts

The extra attempts were a hack to provide best possible sync result for workspaces
with old commits issue. As a result of the "old commits cleanup project &
infinitepush deprecation", all workspaces have been fixed and no longer contain any references to any commit that is not in
Mononoke.

So, nowadays, syncing "2 years, 3 years and then everything" logic just
significantly slows down `hg cloud sync --full` command.

Reviewed By: yancouto

Differential Revision: D40096067

fbshipit-source-id: d9b69140164c38d91d2793b3e0b8c4416d801909
This commit is contained in:
Liubov Dmitrieva 2022-10-05 10:10:47 -07:00 committed by Facebook GitHub Bot
parent e16912e1b0
commit 1077d0a560
2 changed files with 1 additions and 40 deletions

View File

@ -147,36 +147,7 @@ def _sync(
start = util.timer()
startnode = repo["."].node()
if full:
# split the full sync into few passes:
# sync the first 2 years of commits (commits should be present on the server)
# sync the first 3 years of commits (commits should be probably present on the server for most of repos)
# sync the rest of commits (some commits could be missing, haven't been migrated from the old backend)
for years in [2, 3]:
with ui.configoverride({("commitcloud", "max_sync_age"): years * 365}):
ui.status(
_(
"latest %d years of commits will be attempted to synchronize first\n"
)
% years,
component="commitcloud",
)
_sync(
repo,
cloudrefs=cloudrefs,
full=False,
cloudversion=cloudversion,
cloudworkspace=cloudworkspace,
connect_opts=connect_opts,
)
ui.status(
_("latest %d years of commits synchronized\n") % years,
component="commitcloud",
)
maxage = None
else:
maxage = ui.configint("commitcloud", "max_sync_age", None)
maxage = None if full else ui.configint("commitcloud", "max_sync_age", None)
# Work out which repo and workspace we are synchronizing with.
reponame = ccutil.getreponame(repo)

View File

@ -562,7 +562,6 @@ Move the bookmark locally - this still gets synced ok.
A full sync pulls the old commits in
$ cd ../client3
$ hgfakedate 1990-03-05T12:01Z cloud sync --full
commitcloud: latest 2 years of commits will be attempted to synchronize first
commitcloud: synchronizing 'server' with 'user/test/default'
pulling d133b886da68 from ssh://user@dummy/server
searching for changes
@ -571,15 +570,6 @@ A full sync pulls the old commits in
adding file changes
commitcloud: commits synchronized
finished in * (glob)
commitcloud: latest 2 years of commits synchronized
commitcloud: latest 3 years of commits will be attempted to synchronize first
commitcloud: synchronizing 'server' with 'user/test/default'
commitcloud: commits synchronized
finished in * (glob)
commitcloud: latest 3 years of commits synchronized
commitcloud: synchronizing 'server' with 'user/test/default'
commitcloud: commits synchronized
finished in * (glob)
$ tglogp
o d133b886da68 draft 'midstack-feb9'