Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid need to download remote config when pulling #2167

Merged

Conversation

pwithnall
Copy link
Member

Fixes #2165. See that and the commit messages for details.

This doesn’t need additional changes in flatpak for it to be used there too. It does require repositories to regenerate their summary files before the non-fallback code path is taken in clients, though. That’ll happen soon enough naturally.

src/libostree/ostree-repo-pull.c Outdated Show resolved Hide resolved
src/libostree/ostree-repo-pull.c Outdated Show resolved Hide resolved
@@ -5823,6 +5823,24 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
g_variant_new_uint64 (GUINT64_TO_BE (g_get_real_time () / G_USEC_PER_SEC)));
}

{
g_autofree char *remote_mode_str = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can land this hunk to simply add the data to the summary now as a prep patch.

@cgwalters
Copy link
Member

/approve

@pwithnall
Copy link
Member Author

Sorry for the delay. I’ve updated as per the review comments

@jlebon
Copy link
Member

jlebon commented Sep 29, 2020

Looks like test-summary-view.sh needs to be adjusted:

# ([('main', (uint64 12538021362599460864, [byte 0xd9, 0xc5, 0x1e, 0x2a, 0xe5, 0xfe, 0x81, 0x9a, 0x94, 0x0d, 0xba, 0xef, 0x1f, 0xfc, 0xac, 0x98, 0xfa, 0x18, 0x88, 0x2c, 0x6c, 0x74, 0x37, 0x8a, 0x32, 0x40, 0x64, 0xc9, 0xf4, 0x42, 0xbe, 0xc8], {'ostree.commit.timestamp': <uint64 1601051836>})), ('other', (10808639105689190400, [0xbe, 0x51, 0xcd, 0xd8, 0xa1, 0x45, 0x91, 0x87, 0xd4, 0x3a, 0x64, 0x99, 0xdc, 0x45, 0x90, 0x87, 0x79, 0x39, 0x98, 0x15, 0xc4, 0xe6, 0xdf, 0x22, 0xc4, 0x6d, 0x93, 0x9c, 0x98, 0xcf, 0x83, 0xe2], {'ostree.commit.timestamp': <uint64 1601051836>}))], {'ostree.summary.mode': <'archive-z2'>, 'ostree.summary.last-modified': <uint64 1601051836>, 'ostree.summary.tombstone-commits': <false>})
+ fatal 'File '\''raw-summary.txt'\'' doesn'\''t match fixed string list '\''{'\''ostree.summary.last-modified'\'': <uint64'\'''
+ echo File ''\''raw-summary.txt'\''' 'doesn'\''t' match fixed string list ''\''{'\''ostree.summary.last-modified'\'':' '<uint64'\'''
File 'raw-summary.txt' doesn't match fixed string list '{'ostree.summary.last-modified': <uint64'

LGTM otherwise!
/approve

Currently, they are set in the `config` file and cause that to be
downloaded on every pull. Given that the client is already pulling the
`summary` file, it makes sense to avoid an additional network round trip
and cache those options in the `summary` file.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: ostreedev#2165
Otherwise, fall back to downloading and reading them from the `config`
file. See the previous commit for details.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: ostreedev#2165
Re-using the `refs` variable for the main list of refs, plus the
iterated lists, meant that the main list was never freed (although all
the iterated ones were freed correctly).

Fix this by using two variables rather than reusing the one.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
@pwithnall
Copy link
Member Author

Adjusted that test. Not sure what the continuous-integration/jenkins/pr-merge failure is about. The Jenkins page shows only green ticks.

@cgwalters
Copy link
Member

Yeah there's a bug in the UI, you need to go to the old view to see it:

ERROR: tests/test-pull-summary-sigs.sh - too few tests run (expected 10, got 9)
ERROR: tests/test-pull-summary-sigs.sh - exited with status 137 (terminated by signal 9?)

Hmm but we didn't capture the logs from that it seems.

@cgwalters
Copy link
Member

Not sure, I tried retriggering.

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, jlebon, pwithnall

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [cgwalters,jlebon,pwithnall]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 15878c9 into ostreedev:master Oct 1, 2020
@pwithnall pwithnall deleted the 2165-dont-download-config branch October 22, 2020 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid need to download remote config when pulling
5 participants