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

Compute ctl main refactor startup context #7600

Conversation

hlinnaka
Copy link
Contributor

@hlinnaka hlinnaka commented May 3, 2024

A little more refactoring for PR #7577, see comment #7577 (comment)

sharnoff and others added 3 commits May 1, 2024 12:06
A couple lines moved further down in main(), and one case of using
Option<&str> instead of Option<&String>.
This commit is intentionally designed to have as small a diff as
possible. To that end, the basic idea is that each distinct "chunk" of
the previous main() has been wrapped in its own function, with the
return values from each function being passed directly into the next.

The structure of main() is now visible from its contents:

  1. init()
  2. process_cli()
  3. wait_spec()
  4. start_postgres()
  5. wait_postgres()
  6. cleanup_and_exit()

There's a lot of other work that can / should(?) be done beyond this,
but I figure that's more opinionated, and this should be a solid start.
@hlinnaka hlinnaka requested review from a team as code owners May 3, 2024 06:38
@hlinnaka hlinnaka changed the base branch from main to sharnoff/compute_ctl-main()-phase-refactor May 3, 2024 06:38
@hlinnaka hlinnaka requested review from tristan957 and sharnoff May 3, 2024 06:39
@hlinnaka hlinnaka mentioned this pull request May 3, 2024
5 tasks
Copy link

github-actions bot commented May 3, 2024

2862 tests run: 2739 passed, 2 failed, 121 skipped (full report)


Failures on Postgres 16

  • test_branched_empty_timeline_size: debug
  • test_vm_bit_clear_on_heap_lock: debug
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_branched_empty_timeline_size[debug-pg16] or test_vm_bit_clear_on_heap_lock[debug-pg16]"

Test coverage report is not available

The comment gets automatically updated with the latest test results
a77dd07 at 2024-05-03T07:16:02.373Z :recycle:

sharnoff added a commit that referenced this pull request May 4, 2024
This is part 1 of 2 for applying the changes recommended in #7600,
keeping the diff minimal by breaking process_cli into three pieces so we
can extract startup_context_from_env() from the middle.

This will be squashed into the prior commit before merging. Kept it
separate for now, just to make the changes easier to review.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
sharnoff added a commit that referenced this pull request May 4, 2024
Part of applying the changes from #7600. This piece *technically* can
change the semantics because now the context guard is held before
process_cli, but... the difference is likely quite small.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
sharnoff added a commit that referenced this pull request May 4, 2024
This is part 1 of 2 for applying the changes recommended in #7600,
keeping the diff minimal by breaking process_cli into three pieces so we
can extract startup_context_from_env() from the middle.

This will be squashed into the prior commit before merging. Kept it
separate for now, just to make the changes easier to review.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
@sharnoff sharnoff force-pushed the sharnoff/compute_ctl-main()-phase-refactor branch from ffe65ef to 10a0754 Compare May 4, 2024 01:26
sharnoff added a commit that referenced this pull request May 4, 2024
Part of applying the changes from #7600. This piece *technically* can
change the semantics because now the context guard is held before
process_cli, but... the difference is likely quite small.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
@hlinnaka
Copy link
Contributor Author

hlinnaka commented May 4, 2024

These changes were included in PR #7577

@hlinnaka hlinnaka closed this May 4, 2024
sharnoff added a commit that referenced this pull request May 4, 2024
Part of applying the changes from #7600. This piece *technically* can
change the semantics because now the context guard is held before
process_cli, but... the difference is likely quite small.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
sharnoff added a commit that referenced this pull request May 7, 2024
Part of applying the changes from #7600. This piece *technically* can
change the semantics because now the context guard is held before
process_cli, but... the difference is likely quite small.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
sharnoff added a commit that referenced this pull request May 7, 2024
Part of applying the changes from #7600. This piece *technically* can
change the semantics because now the context guard is held before
process_cli, but... the difference is likely quite small.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
conradludgate pushed a commit that referenced this pull request May 8, 2024
Part of applying the changes from #7600. This piece *technically* can
change the semantics because now the context guard is held before
process_cli, but... the difference is likely quite small.

Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants