Full Code of neondatabase/neon for AI

main 39e4f234633f cached
1874 files
20.3 MB
4.0M tokens
12141 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (16,102K chars total). Download the full file to get everything.
Repository: neondatabase/neon
Branch: main
Commit: 39e4f234633f
Files: 1874
Total size: 20.3 MB

Directory structure:
gitextract_l6m7x00t/

├── .cargo/
│   └── config.toml
├── .config/
│   ├── hakari.toml
│   └── nextest.toml
├── .dockerignore
├── .git-blame-ignore-revs
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug-template.md
│   │   ├── config.yml
│   │   └── epic-template.md
│   ├── actionlint.yml
│   ├── actions/
│   │   ├── allure-report-generate/
│   │   │   └── action.yml
│   │   ├── allure-report-store/
│   │   │   └── action.yml
│   │   ├── download/
│   │   │   └── action.yml
│   │   ├── neon-branch-create/
│   │   │   └── action.yml
│   │   ├── neon-branch-delete/
│   │   │   └── action.yml
│   │   ├── neon-project-create/
│   │   │   └── action.yml
│   │   ├── neon-project-delete/
│   │   │   └── action.yml
│   │   ├── prepare-for-subzero/
│   │   │   └── action.yml
│   │   ├── run-python-test-set/
│   │   │   └── action.yml
│   │   ├── save-coverage-data/
│   │   │   └── action.yml
│   │   └── upload/
│   │       └── action.yml
│   ├── file-filters.yaml
│   ├── pull_request_template.md
│   ├── scripts/
│   │   ├── generate_image_maps.py
│   │   ├── lint-release-pr.sh
│   │   ├── previous-releases.jq
│   │   └── push_with_image_map.py
│   └── workflows/
│       ├── _benchmarking_preparation.yml
│       ├── _build-and-test-locally.yml
│       ├── _check-codestyle-python.yml
│       ├── _check-codestyle-rust.yml
│       ├── _meta.yml
│       ├── _push-to-container-registry.yml
│       ├── actionlint.yml
│       ├── approved-for-ci-run.yml
│       ├── benchbase_tpcc.yml
│       ├── benchmarking.yml
│       ├── build-build-tools-image.yml
│       ├── build-macos.yml
│       ├── build_and_run_selected_test.yml
│       ├── build_and_test.yml
│       ├── build_and_test_fully.yml
│       ├── build_and_test_with_sanitizers.yml
│       ├── cargo-deny.yml
│       ├── check-permissions.yml
│       ├── cleanup-caches-by-a-branch.yml
│       ├── cloud-extensions.yml
│       ├── cloud-regress.yml
│       ├── fast-forward.yml
│       ├── force-test-extensions-upgrade.yml
│       ├── ingest_benchmark.yml
│       ├── label-for-external-users.yml
│       ├── large_oltp_benchmark.yml
│       ├── large_oltp_growth.yml
│       ├── lint-release-pr.yml
│       ├── neon_extra_builds.yml
│       ├── periodic_pagebench.yml
│       ├── pg-clients.yml
│       ├── pin-build-tools-image.yml
│       ├── pre-merge-checks.yml
│       ├── proxy-benchmark.yml
│       ├── random-ops-test.yml
│       ├── regenerate-pg-setting.yml
│       ├── release-compute.yml
│       ├── release-notify.yml
│       ├── release-proxy.yml
│       ├── release-storage.yml
│       ├── release.yml
│       ├── report-workflow-stats-batch.yml
│       └── trigger-e2e-tests.yml
├── .gitignore
├── .gitmodules
├── .neon_clippy_args
├── CODEOWNERS
├── CONTRIBUTING.md
├── Cargo.toml
├── Dockerfile
├── LICENSE
├── Makefile
├── NOTICE
├── README.md
├── build-tools/
│   ├── Dockerfile
│   ├── package.json
│   └── patches/
│       └── pgcopydbv017.patch
├── clippy.toml
├── compute/
│   ├── .gitignore
│   ├── Makefile
│   ├── README.md
│   ├── compute-node.Dockerfile
│   ├── etc/
│   │   ├── README.md
│   │   ├── ld.so.conf.d/
│   │   │   └── 00-neon.conf
│   │   ├── neon_collector.jsonnet
│   │   ├── neon_collector_autoscaling.jsonnet
│   │   ├── pgbouncer.ini
│   │   ├── postgres_exporter.yml
│   │   ├── sql_exporter/
│   │   │   ├── checkpoints_req.17.sql
│   │   │   ├── checkpoints_req.libsonnet
│   │   │   ├── checkpoints_req.sql
│   │   │   ├── checkpoints_timed.17.sql
│   │   │   ├── checkpoints_timed.libsonnet
│   │   │   ├── checkpoints_timed.sql
│   │   │   ├── compute_backpressure_throttling_seconds_total.libsonnet
│   │   │   ├── compute_backpressure_throttling_seconds_total.sql
│   │   │   ├── compute_current_lsn.libsonnet
│   │   │   ├── compute_current_lsn.sql
│   │   │   ├── compute_getpage_max_inflight_stuck_time_ms.libsonnet
│   │   │   ├── compute_getpage_stuck_requests_total.libsonnet
│   │   │   ├── compute_logical_snapshot_files.libsonnet
│   │   │   ├── compute_logical_snapshot_files.sql
│   │   │   ├── compute_logical_snapshots_bytes.15.sql
│   │   │   ├── compute_logical_snapshots_bytes.libsonnet
│   │   │   ├── compute_logical_snapshots_bytes.sql
│   │   │   ├── compute_max_connections.libsonnet
│   │   │   ├── compute_max_connections.sql
│   │   │   ├── compute_pg_oldest_frozen_xid_age.libsonnet
│   │   │   ├── compute_pg_oldest_frozen_xid_age.sql
│   │   │   ├── compute_pg_oldest_mxid_age.libsonnet
│   │   │   ├── compute_pg_oldest_mxid_age.sql
│   │   │   ├── compute_receive_lsn.libsonnet
│   │   │   ├── compute_receive_lsn.sql
│   │   │   ├── compute_subscriptions_count.libsonnet
│   │   │   ├── compute_subscriptions_count.sql
│   │   │   ├── connection_counts.libsonnet
│   │   │   ├── connection_counts.sql
│   │   │   ├── db_total_size.libsonnet
│   │   │   ├── db_total_size.sql
│   │   │   ├── file_cache_read_wait_seconds_bucket.libsonnet
│   │   │   ├── file_cache_read_wait_seconds_bucket.sql
│   │   │   ├── file_cache_read_wait_seconds_count.libsonnet
│   │   │   ├── file_cache_read_wait_seconds_sum.libsonnet
│   │   │   ├── file_cache_write_wait_seconds_bucket.libsonnet
│   │   │   ├── file_cache_write_wait_seconds_bucket.sql
│   │   │   ├── file_cache_write_wait_seconds_count.libsonnet
│   │   │   ├── file_cache_write_wait_seconds_sum.libsonnet
│   │   │   ├── getpage_prefetch_discards_total.libsonnet
│   │   │   ├── getpage_prefetch_misses_total.libsonnet
│   │   │   ├── getpage_prefetch_requests_total.libsonnet
│   │   │   ├── getpage_prefetches_buffered.libsonnet
│   │   │   ├── getpage_sync_requests_total.libsonnet
│   │   │   ├── getpage_wait_seconds_bucket.libsonnet
│   │   │   ├── getpage_wait_seconds_bucket.sql
│   │   │   ├── getpage_wait_seconds_count.libsonnet
│   │   │   ├── getpage_wait_seconds_sum.libsonnet
│   │   │   ├── lfc_approximate_working_set_size.libsonnet
│   │   │   ├── lfc_approximate_working_set_size.sql
│   │   │   ├── lfc_approximate_working_set_size_windows.autoscaling.libsonnet
│   │   │   ├── lfc_approximate_working_set_size_windows.autoscaling.sql
│   │   │   ├── lfc_approximate_working_set_size_windows.libsonnet
│   │   │   ├── lfc_approximate_working_set_size_windows.sql
│   │   │   ├── lfc_cache_size_limit.libsonnet
│   │   │   ├── lfc_cache_size_limit.sql
│   │   │   ├── lfc_chunk_size.libsonnet
│   │   │   ├── lfc_chunk_size.sql
│   │   │   ├── lfc_hits.libsonnet
│   │   │   ├── lfc_hits.sql
│   │   │   ├── lfc_misses.libsonnet
│   │   │   ├── lfc_misses.sql
│   │   │   ├── lfc_used.libsonnet
│   │   │   ├── lfc_used.sql
│   │   │   ├── lfc_used_pages.libsonnet
│   │   │   ├── lfc_used_pages.sql
│   │   │   ├── lfc_writes.libsonnet
│   │   │   ├── lfc_writes.sql
│   │   │   ├── logical_slot_restart_lsn.libsonnet
│   │   │   ├── logical_slot_restart_lsn.sql
│   │   │   ├── max_cluster_size.libsonnet
│   │   │   ├── max_cluster_size.sql
│   │   │   ├── neon_perf_counters.sql
│   │   │   ├── pageserver_disconnects_total.libsonnet
│   │   │   ├── pageserver_open_requests.libsonnet
│   │   │   ├── pageserver_requests_sent_total.libsonnet
│   │   │   ├── pageserver_send_flushes_total.libsonnet
│   │   │   ├── pg_stats_userdb.libsonnet
│   │   │   ├── pg_stats_userdb.sql
│   │   │   ├── replication_delay_bytes.libsonnet
│   │   │   ├── replication_delay_bytes.sql
│   │   │   ├── replication_delay_seconds.libsonnet
│   │   │   ├── replication_delay_seconds.sql
│   │   │   ├── retained_wal.libsonnet
│   │   │   ├── retained_wal.sql
│   │   │   ├── wal_is_lost.libsonnet
│   │   │   └── wal_is_lost.sql
│   │   └── sql_exporter.jsonnet
│   ├── jsonnet/
│   │   └── neon.libsonnet
│   ├── manifest.schema.json
│   ├── manifest.yaml
│   ├── patches/
│   │   ├── anon_v2.patch
│   │   ├── cloud_regress_pg16.patch
│   │   ├── cloud_regress_pg17.patch
│   │   ├── contrib_pg16.patch
│   │   ├── contrib_pg17.patch
│   │   ├── duckdb_v113.patch
│   │   ├── duckdb_v120.patch
│   │   ├── onnxruntime.patch
│   │   ├── pg_cron.patch
│   │   ├── pg_duckdb_v031.patch
│   │   ├── pg_graphql.patch
│   │   ├── pg_hint_plan_v16.patch
│   │   ├── pg_hint_plan_v17.patch
│   │   ├── pg_repack.patch
│   │   ├── pg_stat_statements_pg14-16.patch
│   │   ├── pg_stat_statements_pg17.patch
│   │   ├── pgaudit-parallel_workers-v14.patch
│   │   ├── pgaudit-parallel_workers-v15.patch
│   │   ├── pgaudit-parallel_workers-v16.patch
│   │   ├── pgaudit-parallel_workers-v17.patch
│   │   ├── pgvector.patch
│   │   ├── plv8_v3.1.10.patch
│   │   ├── plv8_v3.2.3.patch
│   │   ├── postgres_fdw.patch
│   │   └── rum.patch
│   ├── vm-image-spec-bookworm.yaml
│   └── vm-image-spec-bullseye.yaml
├── compute_tools/
│   ├── .dockerignore
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── README.md
│   ├── rustfmt.toml
│   ├── src/
│   │   ├── bin/
│   │   │   ├── compute_ctl.rs
│   │   │   ├── fast_import/
│   │   │   │   ├── aws_s3_sync.rs
│   │   │   │   ├── child_stdio_to_log.rs
│   │   │   │   └── s3_uri.rs
│   │   │   └── fast_import.rs
│   │   ├── catalog.rs
│   │   ├── checker.rs
│   │   ├── communicator_socket_client.rs
│   │   ├── compute.rs
│   │   ├── compute_prewarm.rs
│   │   ├── compute_promote.rs
│   │   ├── config.rs
│   │   ├── config_template/
│   │   │   ├── compute_audit_rsyslog_template.conf
│   │   │   └── compute_rsyslog_postgres_export_template.conf
│   │   ├── configurator.rs
│   │   ├── disk_quota.rs
│   │   ├── extension_server.rs
│   │   ├── hadron_metrics.rs
│   │   ├── http/
│   │   │   ├── extract/
│   │   │   │   ├── json.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── path.rs
│   │   │   │   ├── query.rs
│   │   │   │   └── request_id.rs
│   │   │   ├── headers.rs
│   │   │   ├── middleware/
│   │   │   │   ├── authorize.rs
│   │   │   │   ├── mod.rs
│   │   │   │   └── request_id.rs
│   │   │   ├── mod.rs
│   │   │   ├── openapi_spec.yaml
│   │   │   ├── routes/
│   │   │   │   ├── check_writability.rs
│   │   │   │   ├── configure.rs
│   │   │   │   ├── database_schema.rs
│   │   │   │   ├── dbs_and_roles.rs
│   │   │   │   ├── extension_server.rs
│   │   │   │   ├── extensions.rs
│   │   │   │   ├── failpoints.rs
│   │   │   │   ├── grants.rs
│   │   │   │   ├── hadron_liveness_probe.rs
│   │   │   │   ├── insights.rs
│   │   │   │   ├── lfc.rs
│   │   │   │   ├── metrics.rs
│   │   │   │   ├── metrics_json.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── promote.rs
│   │   │   │   ├── refresh_configuration.rs
│   │   │   │   ├── status.rs
│   │   │   │   └── terminate.rs
│   │   │   └── server.rs
│   │   ├── installed_extensions.rs
│   │   ├── lib.rs
│   │   ├── local_proxy.rs
│   │   ├── logger.rs
│   │   ├── lsn_lease.rs
│   │   ├── metrics.rs
│   │   ├── migration.rs
│   │   ├── migrations/
│   │   │   ├── 0001-add_bypass_rls_to_privileged_role.sql
│   │   │   ├── 0002-alter_roles.sql
│   │   │   ├── 0003-grant_pg_create_subscription_to_privileged_role.sql
│   │   │   ├── 0004-grant_pg_monitor_to_privileged_role.sql
│   │   │   ├── 0005-grant_all_on_tables_to_privileged_role.sql
│   │   │   ├── 0006-grant_all_on_sequences_to_privileged_role.sql
│   │   │   ├── 0007-grant_all_on_tables_with_grant_option_to_privileged_role.sql
│   │   │   ├── 0008-grant_all_on_sequences_with_grant_option_to_privileged_role.sql
│   │   │   ├── 0009-revoke_replication_for_previously_allowed_roles.sql
│   │   │   ├── 0010-grant_snapshot_synchronization_funcs_to_privileged_role.sql
│   │   │   ├── 0011-grant_pg_show_replication_origin_status_to_privileged_role.sql
│   │   │   ├── 0012-grant_pg_signal_backend_to_privileged_role.sql
│   │   │   └── tests/
│   │   │       ├── 0001-add_bypass_rls_to_privileged_role.sql
│   │   │       ├── 0002-alter_roles.sql
│   │   │       ├── 0003-grant_pg_create_subscription_to_privileged_role.sql
│   │   │       ├── 0004-grant_pg_monitor_to_privileged_role.sql
│   │   │       ├── 0005-grant_all_on_tables_to_privileged_role.sql
│   │   │       ├── 0006-grant_all_on_sequences_to_privileged_role.sql
│   │   │       ├── 0007-grant_all_on_tables_with_grant_option_to_privileged_role.sql
│   │   │       ├── 0008-grant_all_on_sequences_with_grant_option_to_privileged_role.sql
│   │   │       ├── 0009-revoke_replication_for_previously_allowed_roles.sql
│   │   │       ├── 0010-grant_snapshot_synchronization_funcs_to_privileged_role.sql
│   │   │       ├── 0011-grant_pg_show_replication_origin_status_to_privileged_role.sql
│   │   │       └── 0012-grant_pg_signal_backend_to_privileged_role.sql
│   │   ├── monitor.rs
│   │   ├── params.rs
│   │   ├── pg_helpers.rs
│   │   ├── pg_isready.rs
│   │   ├── pgbouncer.rs
│   │   ├── rsyslog.rs
│   │   ├── spec.rs
│   │   ├── spec_apply.rs
│   │   ├── sql/
│   │   │   ├── add_availabilitycheck_tables.sql
│   │   │   ├── alter_databricks_reader_roles_timeout.sql
│   │   │   ├── create_databricks_misc.sql
│   │   │   ├── create_privileged_role.sql
│   │   │   ├── default_grants.sql
│   │   │   ├── drop_subscriptions.sql
│   │   │   ├── finalize_drop_subscriptions.sql
│   │   │   ├── pre_drop_role_revoke_privileges.sql
│   │   │   ├── set_public_schema_owner.sql
│   │   │   └── unset_template_for_drop_dbs.sql
│   │   ├── swap.rs
│   │   ├── sync_sk.rs
│   │   └── tls.rs
│   └── tests/
│       ├── README.md
│       ├── cluster_spec.json
│       ├── config_test.rs
│       └── pg_helpers_tests.rs
├── control_plane/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── README.md
│   ├── safekeepers.conf
│   ├── simple.conf
│   ├── src/
│   │   ├── background_process.rs
│   │   ├── bin/
│   │   │   └── neon_local.rs
│   │   ├── branch_mappings.rs
│   │   ├── broker.rs
│   │   ├── endpoint.rs
│   │   ├── endpoint_storage.rs
│   │   ├── lib.rs
│   │   ├── local_env.rs
│   │   ├── pageserver.rs
│   │   ├── postgresql_conf.rs
│   │   ├── safekeeper.rs
│   │   └── storage_controller.rs
│   └── storcon_cli/
│       ├── Cargo.toml
│       └── src/
│           └── main.rs
├── deny.toml
├── diesel.toml
├── docker-compose/
│   ├── README.md
│   ├── compute_wrapper/
│   │   ├── Dockerfile
│   │   ├── private-key.pem
│   │   ├── public-key.der
│   │   ├── public-key.pem
│   │   ├── shell/
│   │   │   └── compute.sh
│   │   └── var/
│   │       └── db/
│   │           └── postgres/
│   │               └── configs/
│   │                   └── config.json
│   ├── docker-compose.yml
│   ├── docker_compose_test.sh
│   ├── ext-src/
│   │   ├── README.md
│   │   ├── alter_db.sh
│   │   ├── h3-pg-src/
│   │   │   ├── neon-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── hll-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── hypopg-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── ip4r-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── online_advisor-src/
│   │   │   ├── neon-test.sh
│   │   │   └── regular-test.sh
│   │   ├── pg_cron-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_graphql-src/
│   │   │   ├── neon-test.sh
│   │   │   └── regular-test.sh
│   │   ├── pg_hint_plan-src/
│   │   │   └── regular-test.sh
│   │   ├── pg_ivm-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── regular.patch
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_jsonschema-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── jsonschema_edge_cases.out
│   │   │   │   └── jsonschema_valid_api.out
│   │   │   └── sql/
│   │   │       ├── jsonschema_edge_cases.sql
│   │   │       └── jsonschema_valid_api.sql
│   │   ├── pg_repack-src/
│   │   │   └── test-upgrade.sh
│   │   ├── pg_roaringbitmap-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_semver-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade-v16.patch
│   │   │   ├── test-upgrade-v17.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_session_jwt-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   └── basic_functions.out
│   │   │   └── sql/
│   │   │       └── basic_functions.sql
│   │   ├── pg_tiktoken-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   └── pg_tiktoken.out
│   │   │   └── sql/
│   │   │       └── pg_tiktoken.sql
│   │   ├── pg_uuidv7-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── pgjwt-src/
│   │   │   ├── neon-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pgrag-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── api_keys.out
│   │   │   │   ├── basic_functions.out
│   │   │   │   ├── chunking_functions.out
│   │   │   │   ├── document_processing.out
│   │   │   │   ├── embedding_api_functions.out
│   │   │   │   ├── embedding_functions.out
│   │   │   │   ├── text_processing.out
│   │   │   │   └── voyageai_functions.out
│   │   │   ├── regular-test.sh
│   │   │   └── sql/
│   │   │       ├── api_keys.sql
│   │   │       ├── basic_functions.sql
│   │   │       ├── chunking_functions.sql
│   │   │       ├── document_processing.sql
│   │   │       ├── embedding_api_functions.sql
│   │   │       ├── text_processing.sql
│   │   │       └── voyageai_functions.sql
│   │   ├── pgtap-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pgvector-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── pgx_ulid-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── 00_ulid_generation.out
│   │   │   │   ├── 01_ulid_conversions.out
│   │   │   │   ├── 02_ulid_conversions.out
│   │   │   │   └── 03_ulid_errors.out
│   │   │   └── sql/
│   │   │       ├── 00_ulid_generation.sql
│   │   │       ├── 01_ulid_conversions.sql
│   │   │       ├── 02_ulid_conversions.sql
│   │   │       └── 03_ulid_errors.sql
│   │   ├── plv8-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── postgis-src/
│   │   │   ├── README-Neon.md
│   │   │   ├── neon-test.sh
│   │   │   ├── postgis-common-v16.patch
│   │   │   ├── postgis-common-v17.patch
│   │   │   ├── postgis-regular-v16.patch
│   │   │   ├── postgis-regular-v17.patch
│   │   │   ├── raster_outdb_template.sql
│   │   │   └── regular-test.sh
│   │   ├── postgresql-unit-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── prefix-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── rag_bge_small_en_v15-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── basic_functions.out
│   │   │   │   ├── basic_functions_enhanced.out
│   │   │   │   ├── embedding_functions.out
│   │   │   │   └── embedding_functions_enhanced.out
│   │   │   └── sql/
│   │   │       ├── basic_functions.sql
│   │   │       ├── basic_functions_enhanced.sql
│   │   │       ├── embedding_functions.sql
│   │   │       └── embedding_functions_enhanced.sql
│   │   ├── rag_jina_reranker_v1_tiny_en-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── reranking_functions.out
│   │   │   │   └── reranking_functions_enhanced.out
│   │   │   └── sql/
│   │   │       ├── reranking_functions.sql
│   │   │       └── reranking_functions_enhanced.sql
│   │   └── rum-src/
│   │       ├── regular-test.sh
│   │       ├── test-upgrade.patch
│   │       └── test-upgrade.sh
│   ├── pageserver_config/
│   │   ├── identity.toml
│   │   └── pageserver.toml
│   ├── run-tests.sh
│   └── test_extensions_upgrade.sh
├── docs/
│   ├── .gitignore
│   ├── SUMMARY.md
│   ├── authentication.md
│   ├── book.toml
│   ├── consumption_metrics.md
│   ├── core_changes.md
│   ├── docker.md
│   ├── error-handling.md
│   ├── glossary.md
│   ├── multitenancy.md
│   ├── pageserver-compaction.md
│   ├── pageserver-page-service.md
│   ├── pageserver-pagecache.md
│   ├── pageserver-processing-getpage.md
│   ├── pageserver-processing-wal.md
│   ├── pageserver-services.md
│   ├── pageserver-storage.md
│   ├── pageserver-tenant-migration.md
│   ├── pageserver-thread-mgmt.md
│   ├── pageserver-walredo.md
│   ├── pageserver.md
│   ├── rfcs/
│   │   ├── 001-cluster-size-limits.md
│   │   ├── 002-storage.md
│   │   ├── 003-laptop-cli.md
│   │   ├── 004-durability.md
│   │   ├── 005-zenith_local.md
│   │   ├── 006-laptop-cli-v2-CLI.md
│   │   ├── 006-laptop-cli-v2-repository-structure.md
│   │   ├── 007-serverless-on-laptop.md
│   │   ├── 008-push-pull.md
│   │   ├── 009-snapshot-first-storage-cli.md
│   │   ├── 009-snapshot-first-storage-pitr.md
│   │   ├── 009-snapshot-first-storage.md
│   │   ├── 010-storage_details.md
│   │   ├── 011-retention-policy.md
│   │   ├── 012-background-tasks.md
│   │   ├── 013-term-history.md
│   │   ├── 014-safekeepers-gossip.md
│   │   ├── 014-storage-lsm.md
│   │   ├── 015-storage-messaging.md
│   │   ├── 016-connection-routing.md
│   │   ├── 017-console-split.md
│   │   ├── 017-timeline-data-management.md
│   │   ├── 018-storage-messaging-2.md
│   │   ├── 019-tenant-timeline-lifecycles.md
│   │   ├── 020-pageserver-s3-coordination.md
│   │   ├── 021-metering.md
│   │   ├── 022-pageserver-delete-from-s3.md
│   │   ├── 023-the-state-of-pageserver-tenant-relocation.md
│   │   ├── 024-extension-loading.md
│   │   ├── 024-user-mgmt.md
│   │   ├── 025-generation-numbers.md
│   │   ├── 026-pageserver-s3-mvcc.md
│   │   ├── 027-crash-consistent-layer-map-through-index-part.md
│   │   ├── 028-pageserver-migration.md
│   │   ├── 029-getpage-throttling.md
│   │   ├── 029-pageserver-wal-disaster-recovery.md
│   │   ├── 030-vectored-timeline-get.md
│   │   ├── 031-sharding-static.md
│   │   ├── 032-shard-splitting.md
│   │   ├── 033-storage-controller-drain-and-fill.md
│   │   ├── 034-ancestor-deletion.md
│   │   ├── 035-safekeeper-dynamic-membership-change.md
│   │   ├── 035-timeline-archive.md
│   │   ├── 036-physical-replication.md
│   │   ├── 037-storage-controller-restarts.md
│   │   ├── 038-aux-file-v2.md
│   │   ├── 038-independent-compute-release.md
│   │   ├── 040-Endpoint-Persistent-Unlogged-Files-Storage.md
│   │   ├── 040-profiling.md
│   │   ├── 041-rel-sparse-keyspace.md
│   │   ├── 041-sharded-ingest.md
│   │   ├── 043-bottom-most-gc-compaction.md
│   │   ├── 044-feature-flag.md
│   │   ├── 2025-02-14-storage-controller.md
│   │   ├── 2025-03-17-compute-prewarm.md
│   │   ├── 2025-04-30-direct-io-for-pageserver.md
│   │   ├── 2025-04-30-pageserver-concurrent-io-on-read-path.md
│   │   ├── 2025-07-07-node-deletion-api-improvement.md
│   │   ├── README.md
│   │   └── YYYY-MM-DD-copy-me.md
│   ├── safekeeper-protocol.md
│   ├── separation-compute-storage.md
│   ├── settings.md
│   ├── sourcetree.md
│   ├── storage_broker.md
│   ├── storage_controller.md
│   ├── synthetic-size.md
│   ├── tools.md
│   ├── updating-postgres.md
│   └── walservice.md
├── endpoint_storage/
│   ├── Cargo.toml
│   └── src/
│       ├── app.rs
│       ├── claims.rs
│       ├── lib.rs
│       ├── main.rs
│       └── openapi_spec.yml
├── libs/
│   ├── compute_api/
│   │   ├── Cargo.toml
│   │   ├── src/
│   │   │   ├── lib.rs
│   │   │   ├── privilege.rs
│   │   │   ├── requests.rs
│   │   │   ├── responses.rs
│   │   │   └── spec.rs
│   │   └── tests/
│   │       └── cluster_spec.json
│   ├── consumption_metrics/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── desim/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── src/
│   │   │   ├── chan.rs
│   │   │   ├── executor.rs
│   │   │   ├── lib.rs
│   │   │   ├── network.rs
│   │   │   ├── node_os.rs
│   │   │   ├── options.rs
│   │   │   ├── proto.rs
│   │   │   ├── time.rs
│   │   │   └── world.rs
│   │   └── tests/
│   │       └── reliable_copy_test.rs
│   ├── http-utils/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── endpoint.rs
│   │       ├── error.rs
│   │       ├── failpoints.rs
│   │       ├── json.rs
│   │       ├── lib.rs
│   │       ├── request.rs
│   │       ├── server.rs
│   │       └── tls_certs.rs
│   ├── metrics/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── hll.rs
│   │       ├── launch_timestamp.rs
│   │       ├── lib.rs
│   │       ├── more_process_metrics.rs
│   │       └── wrappers.rs
│   ├── neon-shmem/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── hash/
│   │       │   ├── core.rs
│   │       │   ├── entry.rs
│   │       │   └── tests.rs
│   │       ├── hash.rs
│   │       ├── lib.rs
│   │       ├── shmem.rs
│   │       └── sync.rs
│   ├── pageserver_api/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── config/
│   │       │   └── tests.rs
│   │       ├── config.rs
│   │       ├── controller_api.rs
│   │       ├── key.rs
│   │       ├── keyspace.rs
│   │       ├── lib.rs
│   │       ├── models/
│   │       │   ├── detach_ancestor.rs
│   │       │   ├── partitioning.rs
│   │       │   └── utilization.rs
│   │       ├── models.rs
│   │       ├── pagestream_api.rs
│   │       ├── reltag.rs
│   │       ├── shard.rs
│   │       └── upcall_api.rs
│   ├── postgres_backend/
│   │   ├── Cargo.toml
│   │   ├── src/
│   │   │   └── lib.rs
│   │   └── tests/
│   │       ├── cert.pem
│   │       ├── key.pem
│   │       └── simple_select.rs
│   ├── postgres_connection/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── postgres_ffi/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── benches/
│   │   │   ├── README.md
│   │   │   └── waldecoder.rs
│   │   ├── bindgen_deps.h
│   │   ├── build.rs
│   │   ├── samples/
│   │   │   └── pg_hba.conf
│   │   ├── src/
│   │   │   ├── controlfile_utils.rs
│   │   │   ├── lib.rs
│   │   │   ├── nonrelfile_utils.rs
│   │   │   ├── pg_constants.rs
│   │   │   ├── pg_constants_v14.rs
│   │   │   ├── pg_constants_v15.rs
│   │   │   ├── pg_constants_v16.rs
│   │   │   ├── pg_constants_v17.rs
│   │   │   ├── relfile_utils.rs
│   │   │   ├── wal_craft_test_export.rs
│   │   │   ├── wal_generator.rs
│   │   │   ├── waldecoder_handler.rs
│   │   │   ├── walrecord.rs
│   │   │   └── xlog_utils.rs
│   │   └── wal_craft/
│   │       ├── Cargo.toml
│   │       └── src/
│   │           ├── bin/
│   │           │   └── wal_craft.rs
│   │           ├── lib.rs
│   │           └── xlog_utils_test.rs
│   ├── postgres_ffi_types/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── constants.rs
│   │       ├── forknum.rs
│   │       └── lib.rs
│   ├── postgres_initdb/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── postgres_versioninfo/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── posthog_client_lite/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── background_loop.rs
│   │       └── lib.rs
│   ├── pq_proto/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── framed.rs
│   │       └── lib.rs
│   ├── proxy/
│   │   ├── README.md
│   │   ├── json/
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       ├── lib.rs
│   │   │       ├── macros.rs
│   │   │       ├── str.rs
│   │   │       └── value.rs
│   │   ├── postgres-protocol2/
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       ├── authentication/
│   │   │       │   ├── mod.rs
│   │   │       │   └── sasl.rs
│   │   │       ├── escape/
│   │   │       │   ├── mod.rs
│   │   │       │   └── test.rs
│   │   │       ├── lib.rs
│   │   │       ├── message/
│   │   │       │   ├── backend.rs
│   │   │       │   ├── frontend.rs
│   │   │       │   └── mod.rs
│   │   │       ├── password/
│   │   │       │   ├── mod.rs
│   │   │       │   └── test.rs
│   │   │       └── types/
│   │   │           ├── mod.rs
│   │   │           └── test.rs
│   │   ├── postgres-types2/
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       ├── lib.rs
│   │   │       ├── private.rs
│   │   │       └── type_gen.rs
│   │   ├── subzero_core/
│   │   │   ├── .gitignore
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       └── lib.rs
│   │   └── tokio-postgres2/
│   │       ├── Cargo.toml
│   │       └── src/
│   │           ├── cancel_query.rs
│   │           ├── cancel_query_raw.rs
│   │           ├── cancel_token.rs
│   │           ├── client.rs
│   │           ├── codec.rs
│   │           ├── config.rs
│   │           ├── connect.rs
│   │           ├── connect_raw.rs
│   │           ├── connect_socket.rs
│   │           ├── connect_tls.rs
│   │           ├── connection.rs
│   │           ├── error/
│   │           │   ├── mod.rs
│   │           │   └── sqlstate.rs
│   │           ├── generic_client.rs
│   │           ├── lib.rs
│   │           ├── maybe_tls_stream.rs
│   │           ├── prepare.rs
│   │           ├── query.rs
│   │           ├── row.rs
│   │           ├── simple_query.rs
│   │           ├── statement.rs
│   │           ├── tls.rs
│   │           ├── transaction.rs
│   │           ├── transaction_builder.rs
│   │           └── types.rs
│   ├── remote_storage/
│   │   ├── Cargo.toml
│   │   ├── src/
│   │   │   ├── azure_blob.rs
│   │   │   ├── config.rs
│   │   │   ├── error.rs
│   │   │   ├── gcs_bucket.rs
│   │   │   ├── lib.rs
│   │   │   ├── local_fs.rs
│   │   │   ├── metrics.rs
│   │   │   ├── s3_bucket.rs
│   │   │   ├── simulate_failures.rs
│   │   │   └── support.rs
│   │   └── tests/
│   │       ├── common/
│   │       │   ├── mod.rs
│   │       │   └── tests.rs
│   │       ├── test_real_azure.rs
│   │       ├── test_real_gcs.rs
│   │       └── test_real_s3.rs
│   ├── safekeeper_api/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── lib.rs
│   │       ├── membership.rs
│   │       └── models.rs
│   ├── tenant_size_model/
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── src/
│   │   │   ├── calculation.rs
│   │   │   ├── lib.rs
│   │   │   └── svg.rs
│   │   └── tests/
│   │       └── tests.rs
│   ├── tracing-utils/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── http.rs
│   │       ├── lib.rs
│   │       └── perf_span.rs
│   ├── utils/
│   │   ├── Cargo.toml
│   │   ├── benches/
│   │   │   ├── README.md
│   │   │   └── benchmarks.rs
│   │   ├── scripts/
│   │   │   ├── restore_from_wal.sh
│   │   │   └── restore_from_wal_initdb.sh
│   │   ├── src/
│   │   │   ├── auth.rs
│   │   │   ├── backoff.rs
│   │   │   ├── bin_ser.rs
│   │   │   ├── circuit_breaker.rs
│   │   │   ├── completion.rs
│   │   │   ├── crashsafe.rs
│   │   │   ├── elapsed_accum.rs
│   │   │   ├── env.rs
│   │   │   ├── error.rs
│   │   │   ├── failpoint_support.rs
│   │   │   ├── fs_ext/
│   │   │   │   └── rename_noreplace.rs
│   │   │   ├── fs_ext.rs
│   │   │   ├── generation.rs
│   │   │   ├── guard_arc_swap.rs
│   │   │   ├── hex.rs
│   │   │   ├── id.rs
│   │   │   ├── ip_address.rs
│   │   │   ├── leaky_bucket.rs
│   │   │   ├── lib.rs
│   │   │   ├── linux_socket_ioctl.rs
│   │   │   ├── lock_file.rs
│   │   │   ├── logging.rs
│   │   │   ├── lsn.rs
│   │   │   ├── measured_stream.rs
│   │   │   ├── metrics_collector.rs
│   │   │   ├── pageserver_feedback.rs
│   │   │   ├── pid_file.rs
│   │   │   ├── poison.rs
│   │   │   ├── postgres_client.rs
│   │   │   ├── rate_limit.rs
│   │   │   ├── sentry_init.rs
│   │   │   ├── seqwait.rs
│   │   │   ├── serde_percent.rs
│   │   │   ├── serde_regex.rs
│   │   │   ├── serde_system_time.rs
│   │   │   ├── shard.rs
│   │   │   ├── signals.rs
│   │   │   ├── simple_rcu.rs
│   │   │   ├── span.rs
│   │   │   ├── sync/
│   │   │   │   ├── duplex/
│   │   │   │   │   └── mpsc.rs
│   │   │   │   ├── duplex.rs
│   │   │   │   ├── gate.rs
│   │   │   │   ├── heavier_once_cell.rs
│   │   │   │   └── spsc_fold.rs
│   │   │   ├── sync.rs
│   │   │   ├── tcp_listener.rs
│   │   │   ├── timeout.rs
│   │   │   ├── toml_edit_ext.rs
│   │   │   ├── tracing_span_assert.rs
│   │   │   ├── try_rcu.rs
│   │   │   ├── vec_map.rs
│   │   │   ├── yielding_loop.rs
│   │   │   └── zstd.rs
│   │   └── tests/
│   │       └── bin_ser_test.rs
│   ├── vm_monitor/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── bin/
│   │       │   └── monitor.rs
│   │       ├── cgroup.rs
│   │       ├── dispatcher.rs
│   │       ├── filecache.rs
│   │       ├── lib.rs
│   │       ├── protocol.rs
│   │       └── runner.rs
│   ├── wal_decoder/
│   │   ├── Cargo.toml
│   │   ├── benches/
│   │   │   ├── README.md
│   │   │   └── bench_interpret_wal.rs
│   │   ├── build.rs
│   │   ├── proto/
│   │   │   └── interpreted_wal.proto
│   │   └── src/
│   │       ├── decoder.rs
│   │       ├── lib.rs
│   │       ├── models/
│   │       │   ├── record.rs
│   │       │   └── value.rs
│   │       ├── models.rs
│   │       ├── serialized_batch.rs
│   │       └── wire_format.rs
│   └── walproposer/
│       ├── Cargo.toml
│       ├── bindgen_deps.h
│       ├── build.rs
│       └── src/
│           ├── api_bindings.rs
│           ├── lib.rs
│           └── walproposer.rs
├── pageserver/
│   ├── Cargo.toml
│   ├── benches/
│   │   ├── README.md
│   │   ├── bench_ingest.rs
│   │   ├── bench_layer_map.rs
│   │   ├── bench_metrics.rs
│   │   ├── bench_walredo.rs
│   │   ├── large-layer-map-layernames.txt
│   │   ├── odd-brook-layernames.txt
│   │   └── upload_queue.rs
│   ├── client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── lib.rs
│   │       ├── mgmt_api/
│   │       │   └── util.rs
│   │       ├── mgmt_api.rs
│   │       └── page_service.rs
│   ├── client_grpc/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── client.rs
│   │       ├── lib.rs
│   │       ├── pool.rs
│   │       └── retry.rs
│   ├── compaction/
│   │   ├── Cargo.toml
│   │   ├── TODO.md
│   │   ├── src/
│   │   │   ├── bin/
│   │   │   │   └── compaction-simulator.rs
│   │   │   ├── compact_tiered.rs
│   │   │   ├── helpers.rs
│   │   │   ├── identify_levels.rs
│   │   │   ├── interface.rs
│   │   │   ├── lib.rs
│   │   │   ├── simulator/
│   │   │   │   └── draw.rs
│   │   │   └── simulator.rs
│   │   └── tests/
│   │       └── tests.rs
│   ├── ctl/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── download_remote_object.rs
│   │       ├── draw_timeline_dir.rs
│   │       ├── index_part.rs
│   │       ├── key.rs
│   │       ├── layer_map_analyzer.rs
│   │       ├── layers.rs
│   │       ├── main.rs
│   │       └── page_trace.rs
│   ├── page_api/
│   │   ├── Cargo.toml
│   │   ├── build.rs
│   │   ├── proto/
│   │   │   └── page_service.proto
│   │   └── src/
│   │       ├── client.rs
│   │       ├── lib.rs
│   │       ├── model.rs
│   │       └── split.rs
│   ├── pagebench/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── cmd/
│   │       │   ├── aux_files.rs
│   │       │   ├── basebackup.rs
│   │       │   ├── getpage_latest_lsn.rs
│   │       │   ├── idle_streams.rs
│   │       │   ├── ondemand_download_churn.rs
│   │       │   └── trigger_initial_size_calculation.rs
│   │       ├── main.rs
│   │       └── util/
│   │           ├── cli/
│   │           │   └── targets.rs
│   │           ├── request_stats.rs
│   │           └── tokio_thread_local_stats.rs
│   ├── src/
│   │   ├── assert_u64_eq_usize.rs
│   │   ├── auth.rs
│   │   ├── aux_file.rs
│   │   ├── basebackup.rs
│   │   ├── basebackup_cache.rs
│   │   ├── bin/
│   │   │   ├── pageserver.rs
│   │   │   └── test_helper_slow_client_reads.rs
│   │   ├── config/
│   │   │   └── ignored_fields.rs
│   │   ├── config.rs
│   │   ├── consumption_metrics/
│   │   │   ├── disk_cache.rs
│   │   │   ├── metrics/
│   │   │   │   └── tests.rs
│   │   │   ├── metrics.rs
│   │   │   └── upload.rs
│   │   ├── consumption_metrics.rs
│   │   ├── context.rs
│   │   ├── controller_upcall_client.rs
│   │   ├── deletion_queue/
│   │   │   ├── deleter.rs
│   │   │   ├── list_writer.rs
│   │   │   └── validator.rs
│   │   ├── deletion_queue.rs
│   │   ├── disk_usage_eviction_task.rs
│   │   ├── feature_resolver.rs
│   │   ├── http/
│   │   │   ├── mod.rs
│   │   │   ├── openapi_spec.yml
│   │   │   └── routes.rs
│   │   ├── import_datadir.rs
│   │   ├── l0_flush.rs
│   │   ├── lib.rs
│   │   ├── metrics.rs
│   │   ├── page_cache.rs
│   │   ├── page_service.rs
│   │   ├── pgdatadir_mapping.rs
│   │   ├── span.rs
│   │   ├── statvfs.rs
│   │   ├── task_mgr.rs
│   │   ├── tenant/
│   │   │   ├── blob_io.rs
│   │   │   ├── block_io.rs
│   │   │   ├── checks.rs
│   │   │   ├── config.rs
│   │   │   ├── debug.rs
│   │   │   ├── disk_btree.rs
│   │   │   ├── disk_btree_test_data.rs
│   │   │   ├── ephemeral_file.rs
│   │   │   ├── gc_block.rs
│   │   │   ├── gc_result.rs
│   │   │   ├── layer_map/
│   │   │   │   ├── historic_layer_coverage.rs
│   │   │   │   └── layer_coverage.rs
│   │   │   ├── layer_map.rs
│   │   │   ├── metadata.rs
│   │   │   ├── mgr.rs
│   │   │   ├── remote_timeline_client/
│   │   │   │   ├── download.rs
│   │   │   │   ├── index.rs
│   │   │   │   ├── manifest.rs
│   │   │   │   └── upload.rs
│   │   │   ├── remote_timeline_client.rs
│   │   │   ├── secondary/
│   │   │   │   ├── downloader.rs
│   │   │   │   ├── heatmap.rs
│   │   │   │   ├── heatmap_uploader.rs
│   │   │   │   └── scheduler.rs
│   │   │   ├── secondary.rs
│   │   │   ├── size.rs
│   │   │   ├── storage_layer/
│   │   │   │   ├── batch_split_writer.rs
│   │   │   │   ├── delta_layer.rs
│   │   │   │   ├── errors.rs
│   │   │   │   ├── filter_iterator.rs
│   │   │   │   ├── image_layer.rs
│   │   │   │   ├── inmemory_layer/
│   │   │   │   │   └── vectored_dio_read.rs
│   │   │   │   ├── inmemory_layer.rs
│   │   │   │   ├── layer/
│   │   │   │   │   ├── failpoints.rs
│   │   │   │   │   └── tests.rs
│   │   │   │   ├── layer.rs
│   │   │   │   ├── layer_desc.rs
│   │   │   │   ├── layer_name.rs
│   │   │   │   └── merge_iterator.rs
│   │   │   ├── storage_layer.rs
│   │   │   ├── tasks.rs
│   │   │   ├── throttle.rs
│   │   │   ├── timeline/
│   │   │   │   ├── analysis.rs
│   │   │   │   ├── compaction.rs
│   │   │   │   ├── delete.rs
│   │   │   │   ├── detach_ancestor.rs
│   │   │   │   ├── eviction_task.rs
│   │   │   │   ├── handle.rs
│   │   │   │   ├── heatmap_layers_downloader.rs
│   │   │   │   ├── import_pgdata/
│   │   │   │   │   ├── flow.rs
│   │   │   │   │   ├── importbucket_client.rs
│   │   │   │   │   ├── importbucket_format.rs
│   │   │   │   │   └── index_part_format.rs
│   │   │   │   ├── import_pgdata.rs
│   │   │   │   ├── init.rs
│   │   │   │   ├── layer_manager.rs
│   │   │   │   ├── logical_size.rs
│   │   │   │   ├── offload.rs
│   │   │   │   ├── span.rs
│   │   │   │   ├── uninit.rs
│   │   │   │   ├── walreceiver/
│   │   │   │   │   ├── connection_manager.rs
│   │   │   │   │   └── walreceiver_connection.rs
│   │   │   │   └── walreceiver.rs
│   │   │   ├── timeline.rs
│   │   │   ├── upload_queue.rs
│   │   │   └── vectored_blob_io.rs
│   │   ├── tenant.rs
│   │   ├── utilization.rs
│   │   ├── virtual_file/
│   │   │   ├── io_engine/
│   │   │   │   └── tokio_epoll_uring_ext.rs
│   │   │   ├── io_engine.rs
│   │   │   ├── metadata.rs
│   │   │   ├── open_options.rs
│   │   │   ├── owned_buffers_io/
│   │   │   │   ├── aligned_buffer/
│   │   │   │   │   ├── alignment.rs
│   │   │   │   │   ├── buffer.rs
│   │   │   │   │   ├── buffer_mut.rs
│   │   │   │   │   ├── raw.rs
│   │   │   │   │   └── slice.rs
│   │   │   │   ├── aligned_buffer.rs
│   │   │   │   ├── io_buf_aligned.rs
│   │   │   │   ├── io_buf_ext.rs
│   │   │   │   ├── slice.rs
│   │   │   │   ├── write/
│   │   │   │   │   └── flush.rs
│   │   │   │   └── write.rs
│   │   │   └── temporary.rs
│   │   ├── virtual_file.rs
│   │   ├── walingest.rs
│   │   ├── walredo/
│   │   │   ├── apply_neon.rs
│   │   │   ├── process/
│   │   │   │   ├── no_leak_child.rs
│   │   │   │   └── protocol.rs
│   │   │   └── process.rs
│   │   └── walredo.rs
│   └── test_data/
│       ├── indices/
│       │   └── mixed_workload/
│       │       ├── README.md
│       │       └── index_part.json
│       ├── short_v14_redo.page
│       └── sk_wal_segment_from_pgbench/
│           ├── 000000010000000000000001.zst
│           └── initdb.tar.zst
├── pgxn/
│   ├── .dir-locals.el
│   ├── .editorconfig
│   ├── Makefile
│   ├── neon/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── bitmap.h
│   │   ├── communicator/
│   │   │   ├── .gitignore
│   │   │   ├── Cargo.toml
│   │   │   ├── README.md
│   │   │   ├── build.rs
│   │   │   ├── cbindgen.toml
│   │   │   └── src/
│   │   │       ├── lib.rs
│   │   │       └── worker_process/
│   │   │           ├── callbacks.rs
│   │   │           ├── control_socket.rs
│   │   │           ├── lfc_metrics.rs
│   │   │           ├── logging.rs
│   │   │           ├── main_loop.rs
│   │   │           ├── mod.rs
│   │   │           └── worker_interface.rs
│   │   ├── communicator.c
│   │   ├── communicator.h
│   │   ├── communicator_process.c
│   │   ├── communicator_process.h
│   │   ├── extension_server.c
│   │   ├── extension_server.h
│   │   ├── file_cache.c
│   │   ├── file_cache.h
│   │   ├── hll.c
│   │   ├── hll.h
│   │   ├── libpagestore.c
│   │   ├── libpqwalproposer.h
│   │   ├── logical_replication_monitor.c
│   │   ├── logical_replication_monitor.h
│   │   ├── neon--1.0--1.1.sql
│   │   ├── neon--1.0.sql
│   │   ├── neon--1.1--1.0.sql
│   │   ├── neon--1.1--1.2.sql
│   │   ├── neon--1.2--1.1.sql
│   │   ├── neon--1.2--1.3.sql
│   │   ├── neon--1.3--1.2.sql
│   │   ├── neon--1.3--1.4.sql
│   │   ├── neon--1.4--1.3.sql
│   │   ├── neon--1.4--1.5.sql
│   │   ├── neon--1.5--1.4.sql
│   │   ├── neon--1.5--1.6.sql
│   │   ├── neon--1.6--1.5.sql
│   │   ├── neon.c
│   │   ├── neon.control
│   │   ├── neon.h
│   │   ├── neon_ddl_handler.c
│   │   ├── neon_ddl_handler.h
│   │   ├── neon_lwlsncache.c
│   │   ├── neon_lwlsncache.h
│   │   ├── neon_perf_counters.c
│   │   ├── neon_perf_counters.h
│   │   ├── neon_pgversioncompat.c
│   │   ├── neon_pgversioncompat.h
│   │   ├── neon_utils.c
│   │   ├── neon_utils.h
│   │   ├── neon_walreader.c
│   │   ├── neon_walreader.h
│   │   ├── pagestore_client.h
│   │   ├── pagestore_smgr.c
│   │   ├── relsize_cache.c
│   │   ├── unstable_extensions.c
│   │   ├── unstable_extensions.h
│   │   ├── walproposer.c
│   │   ├── walproposer.h
│   │   ├── walproposer_compat.c
│   │   ├── walproposer_pg.c
│   │   ├── walsender_hooks.c
│   │   └── walsender_hooks.h
│   ├── neon_rmgr/
│   │   ├── Makefile
│   │   ├── neon_rmgr.c
│   │   ├── neon_rmgr.control
│   │   ├── neon_rmgr.h
│   │   ├── neon_rmgr_decode.c
│   │   └── neon_rmgr_desc.c
│   ├── neon_test_utils/
│   │   ├── Makefile
│   │   ├── neon_test_utils--1.3.sql
│   │   ├── neon_test_utils.control
│   │   └── neontest.c
│   ├── neon_utils/
│   │   ├── Makefile
│   │   ├── neon_utils--1.0.sql
│   │   ├── neon_utils.c
│   │   └── neon_utils.control
│   └── neon_walredo/
│       ├── Makefile
│       ├── inmem_smgr.c
│       ├── inmem_smgr.h
│       ├── neon_seccomp.h
│       ├── seccomp.c
│       └── walredoproc.c
├── postgres.mk
├── pre-commit.py
├── proxy/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── auth/
│       │   ├── backend/
│       │   │   ├── classic.rs
│       │   │   ├── console_redirect.rs
│       │   │   ├── hacks.rs
│       │   │   ├── jwt.rs
│       │   │   ├── local.rs
│       │   │   └── mod.rs
│       │   ├── credentials.rs
│       │   ├── flow.rs
│       │   ├── mod.rs
│       │   └── password_hack.rs
│       ├── batch.rs
│       ├── bin/
│       │   ├── local_proxy.rs
│       │   ├── pg_sni_router.rs
│       │   └── proxy.rs
│       ├── binary/
│       │   ├── local_proxy.rs
│       │   ├── mod.rs
│       │   ├── pg_sni_router.rs
│       │   └── proxy.rs
│       ├── cache/
│       │   ├── common.rs
│       │   ├── mod.rs
│       │   ├── node_info.rs
│       │   └── project_info.rs
│       ├── cancellation.rs
│       ├── compute/
│       │   ├── mod.rs
│       │   └── tls.rs
│       ├── compute_ctl/
│       │   └── mod.rs
│       ├── config.rs
│       ├── console_redirect_proxy.rs
│       ├── context/
│       │   ├── mod.rs
│       │   └── parquet.rs
│       ├── control_plane/
│       │   ├── client/
│       │   │   ├── cplane_proxy_v1.rs
│       │   │   ├── mock.rs
│       │   │   └── mod.rs
│       │   ├── errors.rs
│       │   ├── messages.rs
│       │   ├── mgmt.rs
│       │   └── mod.rs
│       ├── error.rs
│       ├── ext.rs
│       ├── http/
│       │   ├── health_server.rs
│       │   └── mod.rs
│       ├── intern.rs
│       ├── jemalloc.rs
│       ├── lib.rs
│       ├── logging.rs
│       ├── metrics.rs
│       ├── parse.rs
│       ├── pglb/
│       │   ├── copy_bidirectional.rs
│       │   ├── handshake.rs
│       │   ├── inprocess.rs
│       │   ├── mod.rs
│       │   └── passthrough.rs
│       ├── pqproto.rs
│       ├── protocol2.rs
│       ├── proxy/
│       │   ├── connect_auth.rs
│       │   ├── connect_compute.rs
│       │   ├── mod.rs
│       │   ├── retry.rs
│       │   ├── tests/
│       │   │   ├── mitm.rs
│       │   │   └── mod.rs
│       │   └── wake_compute.rs
│       ├── rate_limiter/
│       │   ├── leaky_bucket.rs
│       │   ├── limit_algorithm/
│       │   │   └── aimd.rs
│       │   ├── limit_algorithm.rs
│       │   ├── limiter.rs
│       │   └── mod.rs
│       ├── redis/
│       │   ├── connection_with_credentials_provider.rs
│       │   ├── elasticache.rs
│       │   ├── keys.rs
│       │   ├── kv_ops.rs
│       │   ├── mod.rs
│       │   └── notifications.rs
│       ├── sasl/
│       │   ├── channel_binding.rs
│       │   ├── messages.rs
│       │   ├── mod.rs
│       │   └── stream.rs
│       ├── scram/
│       │   ├── cache.rs
│       │   ├── countmin.rs
│       │   ├── exchange.rs
│       │   ├── key.rs
│       │   ├── messages.rs
│       │   ├── mod.rs
│       │   ├── pbkdf2.rs
│       │   ├── secret.rs
│       │   ├── signature.rs
│       │   └── threadpool.rs
│       ├── serverless/
│       │   ├── backend.rs
│       │   ├── cancel_set.rs
│       │   ├── conn_pool.rs
│       │   ├── conn_pool_lib.rs
│       │   ├── error.rs
│       │   ├── http_conn_pool.rs
│       │   ├── http_util.rs
│       │   ├── json.rs
│       │   ├── local_conn_pool.rs
│       │   ├── mod.rs
│       │   ├── rest.rs
│       │   ├── sql_over_http.rs
│       │   └── websocket.rs
│       ├── signals.rs
│       ├── stream.rs
│       ├── tls/
│       │   ├── client_config.rs
│       │   ├── mod.rs
│       │   ├── postgres_rustls.rs
│       │   └── server_config.rs
│       ├── types.rs
│       ├── url.rs
│       ├── usage_metrics.rs
│       ├── util.rs
│       └── waiters.rs
├── pyproject.toml
├── pytest.ini
├── run_clippy.sh
├── rust-toolchain.toml
├── safekeeper/
│   ├── Cargo.toml
│   ├── benches/
│   │   ├── README.md
│   │   └── receive_wal.rs
│   ├── client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── lib.rs
│   │       └── mgmt_api.rs
│   ├── spec/
│   │   ├── .gitignore
│   │   ├── MCProposerAcceptorReconfig.tla
│   │   ├── MCProposerAcceptorStatic.tla
│   │   ├── ProposerAcceptorReconfig.tla
│   │   ├── ProposerAcceptorStatic.tla
│   │   ├── modelcheck.sh
│   │   ├── models/
│   │   │   ├── MCProposerAcceptorReconfig_p2_a2_t2_l2_c3.cfg
│   │   │   ├── MCProposerAcceptorReconfig_p2_a2_t2_l2_c5.cfg
│   │   │   ├── MCProposerAcceptorReconfig_p2_a3_t2_l2_c3.cfg
│   │   │   ├── MCProposerAcceptorReconfig_p2_a4_t2_l2_c3.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t2_l2.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t3_l2.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t3_l3.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t4_l4.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a5_t2_l2.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a5_t3_l3.cfg
│   │   │   └── MCProposerAcceptorStatic_p2_a5_t4_l3.cfg
│   │   ├── readme.md
│   │   ├── remove_interm_progress.awk
│   │   ├── remove_interm_progress.sh
│   │   └── tlc-results/
│   │       ├── MCProposerAcceptorReconfig.tla-MCProposerAcceptorReconfig_p2_a2_t2_l2_c3.cfg-2024-12-11--04-24-12.log
│   │       ├── MCProposerAcceptorReconfig.tla-MCProposerAcceptorReconfig_p2_a2_t2_l2_c5.cfg-2024-12-11--04-26-11.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t2_l2.cfg-2024-11-06--13-44-17.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t3_l2.cfg-2024-11-15--09-09-58.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t3_l3.cfg-2024-11-06--13-03-51.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t4_l4.cfg-2024-11-06--14-20-25.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t4_l4.cfg-2024-11-06--15-30-45.log
│   │       └── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a5_t2_l2.cfg-2024-11-06--12-09-32.log
│   ├── src/
│   │   ├── auth.rs
│   │   ├── bin/
│   │   │   └── safekeeper.rs
│   │   ├── broker.rs
│   │   ├── control_file.rs
│   │   ├── control_file_upgrade.rs
│   │   ├── copy_timeline.rs
│   │   ├── debug_dump.rs
│   │   ├── hadron.rs
│   │   ├── handler.rs
│   │   ├── http/
│   │   │   ├── mod.rs
│   │   │   ├── openapi_spec.yaml
│   │   │   └── routes.rs
│   │   ├── lib.rs
│   │   ├── metrics.rs
│   │   ├── patch_control_file.rs
│   │   ├── pull_timeline.rs
│   │   ├── rate_limit.rs
│   │   ├── receive_wal.rs
│   │   ├── recovery.rs
│   │   ├── remove_wal.rs
│   │   ├── safekeeper.rs
│   │   ├── send_interpreted_wal.rs
│   │   ├── send_wal.rs
│   │   ├── state.rs
│   │   ├── test_utils.rs
│   │   ├── timeline.rs
│   │   ├── timeline_eviction.rs
│   │   ├── timeline_guard.rs
│   │   ├── timeline_manager.rs
│   │   ├── timelines_global_map.rs
│   │   ├── timelines_set.rs
│   │   ├── wal_backup.rs
│   │   ├── wal_backup_partial.rs
│   │   ├── wal_reader_stream.rs
│   │   ├── wal_service.rs
│   │   └── wal_storage.rs
│   └── tests/
│       ├── misc_test.rs
│       ├── random_test.rs
│       ├── simple_test.rs
│       └── walproposer_sim/
│           ├── block_storage.rs
│           ├── log.rs
│           ├── mod.rs
│           ├── safekeeper.rs
│           ├── safekeeper_disk.rs
│           ├── simulation.rs
│           ├── simulation_logs.rs
│           ├── walproposer_api.rs
│           └── walproposer_disk.rs
├── scripts/
│   ├── benchmark_durations.py
│   ├── check_allowed_errors.sh
│   ├── comment-test-report.js
│   ├── coverage
│   ├── download_basebackup.py
│   ├── force_layer_download.py
│   ├── generate_and_push_perf_report.sh
│   ├── ingest_perf_test_result.py
│   ├── ingest_regress_test_result-new-format.py
│   ├── ninstall.sh
│   ├── perf_report_template.html
│   ├── proxy_bench_results_ingest.py
│   ├── ps_ec2_setup_instance_store
│   ├── pysync
│   ├── pytest
│   ├── reformat
│   ├── sk_cleanup_tenants/
│   │   ├── readme.md
│   │   ├── remote.yaml
│   │   └── script.py
│   └── sk_collect_dumps/
│       ├── .gitignore
│       ├── ansible.cfg
│       ├── pyproject.toml
│       ├── readme.md
│       ├── remote.yaml
│       ├── ssh.cfg
│       └── upload.sh
├── storage_broker/
│   ├── Cargo.toml
│   ├── benches/
│   │   └── rps.rs
│   ├── build.rs
│   ├── proto/
│   │   ├── .gitignore
│   │   └── broker.proto
│   └── src/
│       ├── bin/
│       │   └── storage_broker.rs
│       ├── lib.rs
│       └── metrics.rs
├── storage_controller/
│   ├── Cargo.toml
│   ├── client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── control_api.rs
│   │       └── lib.rs
│   ├── migrations/
│   │   ├── .keep
│   │   ├── 00000000000000_diesel_initial_setup/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-01-07-211257_create_tenant_shards/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-01-07-212945_create_nodes/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-02-29-094122_generations_null/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-03-18-184429_rename_policy/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-03-27-133204_tenant_policies/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-07-23-191537_create_metadata_health/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-07-26-140924_create_leader/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-23-102952_safekeepers/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-23-170149_tenant_id_index/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-27-184400_pageserver_az/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-28-150530_pageserver_az_not_null/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-09-05-104500_tenant_shard_preferred_az/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-12-12-212515_safekeepers_scheduling_policy/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-01-09-160454_safekeepers_remove_active/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-01-15-181207_safekeepers_disabled_to_pause/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-02-11-144848_pageserver_use_https/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-02-14-160526_safekeeper_timelines/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-02-28-141741_safekeeper_use_https/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-03-18-103700_timeline_imports/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-06-01-201442_add_lifecycle_to_nodes/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-06-17-082247_pageserver_grpc_addr/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-07-02-170751_safekeeper_default_no_pause/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-07-08-114340_sk_set_notified_generation/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   └── 2025-07-17-000001_hadron_safekeepers/
│   │       ├── down.sql
│   │       └── up.sql
│   └── src/
│       ├── auth.rs
│       ├── background_node_operations.rs
│       ├── compute_hook.rs
│       ├── hadron_utils.rs
│       ├── heartbeater.rs
│       ├── http.rs
│       ├── id_lock_map.rs
│       ├── leadership.rs
│       ├── lib.rs
│       ├── main.rs
│       ├── metrics.rs
│       ├── node.rs
│       ├── operation_utils.rs
│       ├── pageserver_client.rs
│       ├── peer_client.rs
│       ├── persistence/
│       │   └── split_state.rs
│       ├── persistence.rs
│       ├── reconciler.rs
│       ├── safekeeper.rs
│       ├── safekeeper_client.rs
│       ├── scheduler.rs
│       ├── schema.rs
│       ├── service/
│       │   ├── chaos_injector.rs
│       │   ├── feature_flag.rs
│       │   ├── safekeeper_reconciler.rs
│       │   ├── safekeeper_service.rs
│       │   └── tenant_shard_iterator.rs
│       ├── service.rs
│       ├── tenant_shard.rs
│       └── timeline_import.rs
├── storage_scrubber/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── checks.rs
│       ├── cloud_admin_api.rs
│       ├── find_large_objects.rs
│       ├── garbage.rs
│       ├── lib.rs
│       ├── main.rs
│       ├── metadata_stream.rs
│       ├── pageserver_physical_gc.rs
│       ├── scan_pageserver_metadata.rs
│       ├── scan_safekeeper_metadata.rs
│       └── tenant_snapshot.rs
├── test_runner/
│   ├── README.md
│   ├── bin/
│   │   └── neon_local_create_deep_l0_stack.py
│   ├── cloud_regress/
│   │   ├── README.md
│   │   └── test_cloud_regress.py
│   ├── conftest.py
│   ├── fixtures/
│   │   ├── __init__.py
│   │   ├── auth_tokens.py
│   │   ├── benchmark_fixture.py
│   │   ├── common_types.py
│   │   ├── compare_fixtures.py
│   │   ├── compute_migrations.py
│   │   ├── compute_reconfigure.py
│   │   ├── endpoint/
│   │   │   ├── __init__.py
│   │   │   └── http.py
│   │   ├── fast_import.py
│   │   ├── h2server.py
│   │   ├── httpserver.py
│   │   ├── log_helper.py
│   │   ├── metrics.py
│   │   ├── neon_api.py
│   │   ├── neon_cli.py
│   │   ├── neon_fixtures.py
│   │   ├── overlayfs.py
│   │   ├── pageserver/
│   │   │   ├── __init__.py
│   │   │   ├── allowed_errors.py
│   │   │   ├── common_types.py
│   │   │   ├── http.py
│   │   │   ├── makelayers/
│   │   │   │   ├── __init__.py
│   │   │   │   └── l0stack.py
│   │   │   ├── many_tenants.py
│   │   │   ├── remote_storage.py
│   │   │   └── utils.py
│   │   ├── parametrize.py
│   │   ├── paths.py
│   │   ├── pg_config.py
│   │   ├── pg_stats.py
│   │   ├── pg_version.py
│   │   ├── port_distributor.py
│   │   ├── remote_storage.py
│   │   ├── reruns.py
│   │   ├── safekeeper/
│   │   │   ├── __init__.py
│   │   │   ├── http.py
│   │   │   └── utils.py
│   │   ├── safekeeper_utils.py
│   │   ├── slow.py
│   │   ├── storage_controller_proxy.py
│   │   ├── utils.py
│   │   └── workload.py
│   ├── logical_repl/
│   │   ├── README.md
│   │   ├── clickhouse/
│   │   │   └── docker-compose.yml
│   │   ├── debezium/
│   │   │   └── docker-compose.yml
│   │   ├── test_clickhouse.py
│   │   └── test_debezium.py
│   ├── performance/
│   │   ├── README.md
│   │   ├── __init__.py
│   │   ├── benchbase_tpc_c_helpers/
│   │   │   ├── generate_diagrams.py
│   │   │   ├── generate_workload_size.py
│   │   │   └── upload_results_to_perf_test_results.py
│   │   ├── large_synthetic_oltp/
│   │   │   ├── IUD_one_transaction.sql
│   │   │   ├── grow_action_blocks.sql
│   │   │   ├── grow_action_kwargs.sql
│   │   │   ├── grow_device_fingerprint_event.sql
│   │   │   ├── grow_edges.sql
│   │   │   ├── grow_hotel_rate_mapping.sql
│   │   │   ├── grow_ocr_pipeline_results_version.sql
│   │   │   ├── grow_priceline_raw_response.sql
│   │   │   ├── grow_relabled_transactions.sql
│   │   │   ├── grow_state_values.sql
│   │   │   ├── grow_values.sql
│   │   │   ├── grow_vertices.sql
│   │   │   ├── insert_webhooks.sql
│   │   │   ├── select_any_webhook_with_skew.sql
│   │   │   ├── select_prefetch_webhook.sql
│   │   │   ├── select_recent_webhook.sql
│   │   │   ├── update_accounting_coding_body_tracking_category_selection.sql
│   │   │   ├── update_action_blocks.sql
│   │   │   ├── update_action_kwargs.sql
│   │   │   ├── update_denormalized_approval_workflow.sql
│   │   │   ├── update_device_fingerprint_event.sql
│   │   │   ├── update_edges.sql
│   │   │   ├── update_heron_transaction_enriched_log.sql
│   │   │   ├── update_heron_transaction_enrichment_requests.sql
│   │   │   ├── update_hotel_rate_mapping.sql
│   │   │   ├── update_incoming_webhooks.sql
│   │   │   ├── update_manual_transaction.sql
│   │   │   ├── update_ml_receipt_matching_log.sql
│   │   │   ├── update_ocr_pipeine_results_version.sql
│   │   │   ├── update_orc_pipeline_step_results.sql
│   │   │   ├── update_orc_pipeline_step_results_version.sql
│   │   │   ├── update_priceline_raw_response.sql
│   │   │   ├── update_quickbooks_transactions.sql
│   │   │   ├── update_raw_finicity_transaction.sql
│   │   │   ├── update_relabeled_transactions.sql
│   │   │   ├── update_state_values.sql
│   │   │   ├── update_stripe_authorization_event_log.sql
│   │   │   ├── update_transaction.sql
│   │   │   ├── update_values.sql
│   │   │   └── update_vertices.sql
│   │   ├── many_relations/
│   │   │   └── create_many_relations.sql
│   │   ├── out_dir_to_csv.py
│   │   ├── pageserver/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── interactive/
│   │   │   │   ├── __init__.py
│   │   │   │   └── test_many_small_tenants.py
│   │   │   ├── pagebench/
│   │   │   │   ├── __init__.py
│   │   │   │   ├── test_large_slru_basebackup.py
│   │   │   │   ├── test_ondemand_download_churn.py
│   │   │   │   └── test_pageserver_max_throughput_getpage_at_latest_lsn.py
│   │   │   ├── test_page_service_batching.py
│   │   │   └── util.py
│   │   ├── pgvector/
│   │   │   ├── HNSW_build.sql
│   │   │   ├── IVFFLAT_build.sql
│   │   │   ├── README.md
│   │   │   ├── halfvec_build.sql
│   │   │   ├── loaddata.py
│   │   │   ├── pgbench_custom_script_pgvector_halfvec_queries.sql
│   │   │   └── pgbench_custom_script_pgvector_hsnw_queries.sql
│   │   ├── test_branch_creation.py
│   │   ├── test_branching.py
│   │   ├── test_bulk_insert.py
│   │   ├── test_bulk_tenant_create.py
│   │   ├── test_bulk_update.py
│   │   ├── test_compaction.py
│   │   ├── test_compare_pg_stats.py
│   │   ├── test_compute_ctl_api.py
│   │   ├── test_compute_startup.py
│   │   ├── test_copy.py
│   │   ├── test_cumulative_statistics_persistence.py
│   │   ├── test_dup_key.py
│   │   ├── test_gc_feedback.py
│   │   ├── test_gist_build.py
│   │   ├── test_hot_page.py
│   │   ├── test_hot_table.py
│   │   ├── test_ingest_insert_bulk.py
│   │   ├── test_ingest_logical_message.py
│   │   ├── test_latency.py
│   │   ├── test_layer_map.py
│   │   ├── test_lfc_prewarm.py
│   │   ├── test_logical_replication.py
│   │   ├── test_parallel_copy.py
│   │   ├── test_parallel_copy_to.py
│   │   ├── test_perf_ingest_using_pgcopydb.py
│   │   ├── test_perf_many_relations.py
│   │   ├── test_perf_olap.py
│   │   ├── test_perf_oltp_large_tenant.py
│   │   ├── test_perf_pgbench.py
│   │   ├── test_perf_pgvector_queries.py
│   │   ├── test_physical_replication.py
│   │   ├── test_random_writes.py
│   │   ├── test_seqscans.py
│   │   ├── test_sharded_ingest.py
│   │   ├── test_sharding_autosplit.py
│   │   ├── test_storage_controller_scale.py
│   │   ├── test_wal_backpressure.py
│   │   ├── test_write_amplification.py
│   │   └── tpc-h/
│   │       ├── create-indexes.sql
│   │       ├── create-schema.sql
│   │       └── queries/
│   │           ├── 1.sql
│   │           ├── 10.sql
│   │           ├── 11.sql
│   │           ├── 12.sql
│   │           ├── 13.sql
│   │           ├── 14.sql
│   │           ├── 15.sql
│   │           ├── 16.sql
│   │           ├── 17.sql
│   │           ├── 18.sql
│   │           ├── 19.sql
│   │           ├── 2.sql
│   │           ├── 20.sql
│   │           ├── 21.sql
│   │           ├── 22.sql
│   │           ├── 3.sql
│   │           ├── 4.sql
│   │           ├── 5.sql
│   │           ├── 6.sql
│   │           ├── 7.sql
│   │           ├── 8.sql
│   │           └── 9.sql
│   ├── pg_clients/
│   │   ├── README.md
│   │   ├── csharp/
│   │   │   └── npgsql/
│   │   │       ├── .dockerignore
│   │   │       ├── .gitignore
│   │   │       ├── Dockerfile
│   │   │       ├── Program.cs
│   │   │       └── csharp-npgsql.csproj
│   │   ├── java/
│   │   │   └── jdbc/
│   │   │       ├── Dockerfile
│   │   │       └── Example.java
│   │   ├── python/
│   │   │   ├── asyncpg/
│   │   │   │   ├── Dockerfile
│   │   │   │   ├── asyncpg_example.py
│   │   │   │   └── requirements.txt
│   │   │   └── pg8000/
│   │   │       ├── Dockerfile
│   │   │       ├── pg8000_example.py
│   │   │       └── requirements.txt
│   │   ├── rust/
│   │   │   └── tokio-postgres/
│   │   │       ├── .dockerignore
│   │   │       ├── .gitignore
│   │   │       ├── Cargo.toml
│   │   │       ├── Dockerfile
│   │   │       └── src/
│   │   │           └── main.rs
│   │   ├── swift/
│   │   │   ├── PostgresClientKitExample/
│   │   │   │   ├── .dockerignore
│   │   │   │   ├── .gitignore
│   │   │   │   ├── Dockerfile
│   │   │   │   ├── Package.resolved
│   │   │   │   ├── Package.swift
│   │   │   │   └── Sources/
│   │   │   │       └── PostgresClientKitExample/
│   │   │   │           └── main.swift
│   │   │   └── PostgresNIOExample/
│   │   │       ├── .dockerignore
│   │   │       ├── .gitignore
│   │   │       ├── Dockerfile
│   │   │       ├── Package.resolved
│   │   │       ├── Package.swift
│   │   │       └── Sources/
│   │   │           └── PostgresNIOExample/
│   │   │               └── main.swift
│   │   ├── test_pg_clients.py
│   │   └── typescript/
│   │       ├── postgresql-client/
│   │       │   ├── .dockerignore
│   │       │   ├── .gitignore
│   │       │   ├── Dockerfile
│   │       │   ├── index.js
│   │       │   └── package.json
│   │       └── serverless-driver/
│   │           ├── .dockerignore
│   │           ├── .gitignore
│   │           ├── Dockerfile
│   │           ├── index.js
│   │           └── package.json
│   ├── random_ops/
│   │   ├── README.md
│   │   └── test_random_ops.py
│   ├── regress/
│   │   ├── data/
│   │   │   ├── test_event_trigger_extension/
│   │   │   │   ├── test_event_trigger_extension--1.0.sql
│   │   │   │   └── test_event_trigger_extension.control
│   │   │   ├── test_remote_extensions/
│   │   │   │   ├── test_extension_sql_only/
│   │   │   │   │   ├── sql/
│   │   │   │   │   │   ├── test_extension_sql_only--1.0--1.1.sql
│   │   │   │   │   │   └── test_extension_sql_only--1.0.sql
│   │   │   │   │   └── test_extension_sql_only.control
│   │   │   │   └── test_extension_with_lib/
│   │   │   │       ├── sql/
│   │   │   │       │   ├── test_extension_with_lib--1.0--1.1.sql
│   │   │   │       │   └── test_extension_with_lib--1.0.sql
│   │   │   │       ├── src/
│   │   │   │       │   └── test_extension_with_lib.c
│   │   │   │       └── test_extension_with_lib.control
│   │   │   └── test_signed_char.out
│   │   ├── test_ancestor_branch.py
│   │   ├── test_attach_tenant_config.py
│   │   ├── test_auth.py
│   │   ├── test_auth_broker.py
│   │   ├── test_backpressure.py
│   │   ├── test_bad_connection.py
│   │   ├── test_basebackup.py
│   │   ├── test_basebackup_error.py
│   │   ├── test_branch_and_gc.py
│   │   ├── test_branch_behind.py
│   │   ├── test_branching.py
│   │   ├── test_broken_timeline.py
│   │   ├── test_build_info_metric.py
│   │   ├── test_change_pageserver.py
│   │   ├── test_clog_truncate.py
│   │   ├── test_close_fds.py
│   │   ├── test_combocid.py
│   │   ├── test_communicator_metrics_exporter.py
│   │   ├── test_compaction.py
│   │   ├── test_compatibility.py
│   │   ├── test_compute_catalog.py
│   │   ├── test_compute_http.py
│   │   ├── test_compute_locales.py
│   │   ├── test_compute_metrics.py
│   │   ├── test_compute_migrations.py
│   │   ├── test_compute_monitor.py
│   │   ├── test_compute_reconfigure.py
│   │   ├── test_compute_termination.py
│   │   ├── test_config.py
│   │   ├── test_crafted_wal_end.py
│   │   ├── test_createdropdb.py
│   │   ├── test_createuser.py
│   │   ├── test_ddl_forwarding.py
│   │   ├── test_disk_usage_eviction.py
│   │   ├── test_download_extensions.py
│   │   ├── test_endpoint_crash.py
│   │   ├── test_endpoint_storage.py
│   │   ├── test_event_trigger_extension.py
│   │   ├── test_explain_with_lfc_stats.py
│   │   ├── test_extensions.py
│   │   ├── test_feature_flag.py
│   │   ├── test_fsm_truncate.py
│   │   ├── test_fullbackup.py
│   │   ├── test_gc_aggressive.py
│   │   ├── test_gin_redo.py
│   │   ├── test_gist.py
│   │   ├── test_hadron_ps_connectivity_metrics.py
│   │   ├── test_hcc_handling_ps_data_loss.py
│   │   ├── test_hot_standby.py
│   │   ├── test_import.py
│   │   ├── test_import_pgdata.py
│   │   ├── test_ingestion_layer_size.py
│   │   ├── test_large_schema.py
│   │   ├── test_layer_bloating.py
│   │   ├── test_layer_eviction.py
│   │   ├── test_layer_writers_fail.py
│   │   ├── test_layers_from_future.py
│   │   ├── test_lfc_prefetch.py
│   │   ├── test_lfc_prewarm.py
│   │   ├── test_lfc_resize.py
│   │   ├── test_lfc_working_set_approximation.py
│   │   ├── test_local_file_cache.py
│   │   ├── test_logging.py
│   │   ├── test_logical_replication.py
│   │   ├── test_lsn_mapping.py
│   │   ├── test_multixact.py
│   │   ├── test_nbtree_pagesplit_cycleid.py
│   │   ├── test_neon_cli.py
│   │   ├── test_neon_extension.py
│   │   ├── test_neon_local_cli.py
│   │   ├── test_neon_superuser.py
│   │   ├── test_next_xid.py
│   │   ├── test_normal_work.py
│   │   ├── test_oid_overflow.py
│   │   ├── test_old_request_lsn.py
│   │   ├── test_ondemand_download.py
│   │   ├── test_ondemand_slru_download.py
│   │   ├── test_ondemand_wal_download.py
│   │   ├── test_page_service_batching_regressions.py
│   │   ├── test_pageserver_api.py
│   │   ├── test_pageserver_catchup.py
│   │   ├── test_pageserver_config.py
│   │   ├── test_pageserver_crash_consistency.py
│   │   ├── test_pageserver_generations.py
│   │   ├── test_pageserver_getpage_throttle.py
│   │   ├── test_pageserver_layer_rolling.py
│   │   ├── test_pageserver_metric_collection.py
│   │   ├── test_pageserver_reconnect.py
│   │   ├── test_pageserver_restart.py
│   │   ├── test_pageserver_restarts_under_workload.py
│   │   ├── test_pageserver_secondary.py
│   │   ├── test_pg_query_cancellation.py
│   │   ├── test_pg_regress.py
│   │   ├── test_pg_waldump.py
│   │   ├── test_pgstat.py
│   │   ├── test_physical_and_logical_replicaiton.py
│   │   ├── test_physical_replication.py
│   │   ├── test_pitr_gc.py
│   │   ├── test_postgres_version.py
│   │   ├── test_prefetch_buffer_resize.py
│   │   ├── test_proxy.py
│   │   ├── test_proxy_allowed_ips.py
│   │   ├── test_proxy_metric_collection.py
│   │   ├── test_proxy_websockets.py
│   │   ├── test_read_validation.py
│   │   ├── test_readonly_node.py
│   │   ├── test_recovery.py
│   │   ├── test_relations.py
│   │   ├── test_remote_storage.py
│   │   ├── test_replica_promotes.py
│   │   ├── test_replica_start.py
│   │   ├── test_rest_broker.py
│   │   ├── test_role_grants.py
│   │   ├── test_s3_restore.py
│   │   ├── test_safekeeper_deletion.py
│   │   ├── test_safekeeper_migration.py
│   │   ├── test_setup.py
│   │   ├── test_sharding.py
│   │   ├── test_signed_char.py
│   │   ├── test_sni_router.py
│   │   ├── test_ssl.py
│   │   ├── test_storage_controller.py
│   │   ├── test_storage_scrubber.py
│   │   ├── test_subscriber_branching.py
│   │   ├── test_subscriber_restart.py
│   │   ├── test_subxacts.py
│   │   ├── test_tenant_conf.py
│   │   ├── test_tenant_delete.py
│   │   ├── test_tenant_detach.py
│   │   ├── test_tenant_relocation.py
│   │   ├── test_tenant_size.py
│   │   ├── test_tenant_tasks.py
│   │   ├── test_tenants.py
│   │   ├── test_tenants_with_remote_storage.py
│   │   ├── test_threshold_based_eviction.py
│   │   ├── test_timeline_archive.py
│   │   ├── test_timeline_delete.py
│   │   ├── test_timeline_detach_ancestor.py
│   │   ├── test_timeline_gc_blocking.py
│   │   ├── test_timeline_size.py
│   │   ├── test_truncate.py
│   │   ├── test_twophase.py
│   │   ├── test_unlogged.py
│   │   ├── test_unstable_extensions.py
│   │   ├── test_vm_bits.py
│   │   ├── test_vm_truncate.py
│   │   ├── test_wal_acceptor.py
│   │   ├── test_wal_acceptor_async.py
│   │   ├── test_wal_receiver.py
│   │   ├── test_wal_restore.py
│   │   └── test_walredo_not_left_behind_on_detach.py
│   ├── sql_regress/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── expected/
│   │   │   ├── .gitignore
│   │   │   ├── neon-cid.out
│   │   │   ├── neon-clog.out
│   │   │   ├── neon-event-triggers.out
│   │   │   ├── neon-rel-truncate.out
│   │   │   ├── neon-spgist.out
│   │   │   ├── neon-subxacts.out
│   │   │   ├── neon-test-utils.out
│   │   │   └── neon-vacuum-full.out
│   │   ├── parallel_schedule
│   │   └── sql/
│   │       ├── .gitignore
│   │       ├── neon-cid.sql
│   │       ├── neon-clog.sql
│   │       ├── neon-event-triggers.sql
│   │       ├── neon-rel-truncate.sql
│   │       ├── neon-spgist.sql
│   │       ├── neon-subxacts.sql
│   │       ├── neon-test-utils.sql
│   │       └── neon-vacuum-full.sql
│   ├── stubs/
│   │   └── h2/
│   │       ├── README.md
│   │       ├── __init__.pyi
│   │       ├── config.pyi
│   │       ├── connection.pyi
│   │       ├── errors.pyi
│   │       ├── events.pyi
│   │       ├── exceptions.pyi
│   │       ├── frame_buffer.pyi
│   │       ├── settings.pyi
│   │       ├── stream.pyi
│   │       ├── utilities.pyi
│   │       └── windows.pyi
│   ├── test_broken.py
│   └── websocket_tunnel.py
├── vendor/
│   └── revisions.json
└── workspace_hack/
    ├── .gitattributes
    ├── Cargo.toml
    ├── build.rs
    └── src/
        └── lib.rs

================================================
FILE CONTENTS
================================================

================================================
FILE: .cargo/config.toml
================================================
[build]
# This is only present for local builds, as it will be overridden
# by the RUSTDOCFLAGS env var in CI.
rustdocflags = ["-Arustdoc::private_intra_doc_links"]

# Enable frame pointers. This may have a minor performance overhead, but makes it easier and more
# efficient to obtain stack traces (and thus CPU/heap profiles). It may also avoid seg faults that
# we've seen with libunwind-based profiling. See also:
#
# * <https://www.brendangregg.com/blog/2024-03-17/the-return-of-the-frame-pointers.html>
# * <https://github.com/rust-lang/rust/pull/122646>
#
# NB: the RUSTFLAGS envvar will replace this. Make sure to update e.g. Dockerfile as well.
rustflags = ["-Cforce-frame-pointers=yes"]

[alias]
build_testing = ["build", "--features", "testing"]
neon = ["run", "--bin", "neon_local"]


================================================
FILE: .config/hakari.toml
================================================
# This file contains settings for `cargo hakari`.
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.

hakari-package = "workspace_hack"

# Format for `workspace-hack = ...` lines in other Cargo.tomls. Requires cargo-hakari 0.9.8 or above.
dep-format-version = "4"

# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
# Hakari works much better with the new feature resolver.
# For more about the new feature resolver, see:
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
# Have to keep the resolver still here since hakari requires this field,
# despite it's now the default for 2021 edition & cargo.
resolver = "2"

# Add triples corresponding to platforms commonly used by developers here.
# https://doc.rust-lang.org/rustc/platform-support.html
platforms = [
    # "x86_64-unknown-linux-gnu",
    # "x86_64-apple-darwin",
    # "x86_64-pc-windows-msvc",
]
[final-excludes]
workspace-members = [
    # vm_monitor benefits from the same Cargo.lock as the rest of our artifacts, but
    # it is built primarly in separate repo neondatabase/autoscaling and thus is excluded
    # from depending on workspace-hack because most of the dependencies are not used.
    "vm_monitor",
    # subzero-core is a stub crate that should be excluded from workspace-hack
    "subzero-core",
    # All of these exist in libs and are not usually built independently.
    # Putting workspace hack there adds a bottleneck for cargo builds.
    "compute_api",
    "consumption_metrics",
    "desim",
    "json",
    "metrics",
    "pageserver_api",
    "postgres_backend",
    "postgres_connection",
    "postgres_ffi",
    "pq_proto",
    "remote_storage",
    "safekeeper_api",
    "tenant_size_model",
    "tracing-utils",
    "utils",
    "wal_craft",
    "walproposer",
    "postgres-protocol2",
    "postgres-types2",
    "tokio-postgres2",
]

# Write out exact versions rather than a semver range. (Defaults to false.)
# exact-versions = true


================================================
FILE: .config/nextest.toml
================================================
[profile.default]
slow-timeout = { period = "60s", terminate-after = 3 }


================================================
FILE: .dockerignore
================================================
*

# Files
!Cargo.lock
!Cargo.toml
!Makefile
!postgres.mk
!rust-toolchain.toml
!scripts/ninstall.sh
!docker-compose/run-tests.sh

# Directories
!.cargo/
!.config/
!compute/
!compute_tools/
!control_plane/
!docker-compose/ext-src
!libs/
!pageserver/
!pgxn/
!proxy/
!endpoint_storage/
!storage_scrubber/
!safekeeper/
!storage_broker/
!storage_controller/
!vendor/postgres-*/
!workspace_hack/
!build-tools/patches


================================================
FILE: .git-blame-ignore-revs
================================================
4c2bb43775947775401cbb9d774823c5723a91f8


================================================
FILE: .gitattributes
================================================
# allows for nicer hunk headers with git show
*.rs diff=rust


================================================
FILE: .github/ISSUE_TEMPLATE/bug-template.md
================================================
---
name: Bug Template
about: Used for describing bugs
title: ''
labels: t/bug
type: Bug
assignees: ''

---

## Steps to reproduce


## Expected result


## Actual result


## Environment


## Logs, links
- 


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================

blank_issues_enabled: true
contact_links:
  - name: Feature request
    url: https://console.neon.tech/app/projects?modal=feedback
    about: For feature requests in the Neon product, please submit via the feedback form on `https://console.neon.tech`


================================================
FILE: .github/ISSUE_TEMPLATE/epic-template.md
================================================
---
name: Epic Template
about: A set of related tasks contributing towards specific outcome, comprising of
  more than 1 week of work.
title: 'Epic: '
labels: t/Epic
type: Epic
assignees: ''

---

## Motivation


## DoD


## Implementation ideas

## Tasks
```[tasklist]
- [ ] Example Task
```


## Other related tasks and Epics
- 


================================================
FILE: .github/actionlint.yml
================================================
self-hosted-runner:
  labels:
    - arm64
    - large
    - large-arm64
    - small
    - small-metal
    - small-arm64
    - unit-perf
    - unit-perf-aws-arm
    - us-east-2
config-variables:
  - AWS_ECR_REGION
  - AZURE_DEV_CLIENT_ID
  - AZURE_DEV_REGISTRY_NAME
  - AZURE_DEV_SUBSCRIPTION_ID
  - AZURE_PROD_CLIENT_ID
  - AZURE_PROD_REGISTRY_NAME
  - AZURE_PROD_SUBSCRIPTION_ID
  - AZURE_TENANT_ID
  - BENCHMARK_INGEST_TARGET_PROJECTID
  - BENCHMARK_LARGE_OLTP_PROJECTID
  - BENCHMARK_PROJECT_ID_PUB
  - BENCHMARK_PROJECT_ID_SUB
  - DEV_AWS_OIDC_ROLE_ARN
  - DEV_AWS_OIDC_ROLE_MANAGE_BENCHMARK_EC2_VMS_ARN
  - HETZNER_CACHE_BUCKET
  - HETZNER_CACHE_ENDPOINT
  - HETZNER_CACHE_REGION
  - NEON_DEV_AWS_ACCOUNT_ID
  - NEON_PROD_AWS_ACCOUNT_ID
  - PGREGRESS_PG16_PROJECT_ID
  - PGREGRESS_PG17_PROJECT_ID
  - PREWARM_PROJECT_ID
  - REMOTE_STORAGE_AZURE_CONTAINER
  - REMOTE_STORAGE_AZURE_REGION
  - SLACK_CICD_CHANNEL_ID
  - SLACK_COMPUTE_CHANNEL_ID
  - SLACK_ON_CALL_DEVPROD_STREAM
  - SLACK_ON_CALL_QA_STAGING_STREAM
  - SLACK_ON_CALL_STORAGE_STAGING_STREAM
  - SLACK_ONCALL_COMPUTE_GROUP
  - SLACK_ONCALL_PROXY_GROUP
  - SLACK_ONCALL_STORAGE_GROUP
  - SLACK_PROXY_CHANNEL_ID
  - SLACK_RUST_CHANNEL_ID
  - SLACK_STORAGE_CHANNEL_ID
  - SLACK_UPCOMING_RELEASE_CHANNEL_ID


================================================
FILE: .github/actions/allure-report-generate/action.yml
================================================
name: 'Create Allure report'
description: 'Generate Allure report from uploaded by actions/allure-report-store tests results'

inputs:
  store-test-results-into-db:
    description: 'Whether to store test results into the database. TEST_RESULT_CONNSTR/TEST_RESULT_CONNSTR_NEW should be set'
    type: boolean
    required: false
    default: false
  aws-oidc-role-arn:
    description: 'OIDC role arn to interract with S3'
    required: true

outputs:
  base-url:
    description: 'Base URL for Allure report'
    value: ${{ steps.generate-report.outputs.base-url }}
  base-s3-url:
    description: 'Base S3 URL for Allure report'
    value: ${{ steps.generate-report.outputs.base-s3-url }}
  report-url:
    description: 'Allure report URL'
    value: ${{ steps.generate-report.outputs.report-url }}
  report-json-url:
    description: 'Allure report JSON URL'
    value: ${{ steps.generate-report.outputs.report-json-url }}

runs:
  using: "composite"

  steps:
    # We're using some of env variables quite offen, so let's set them once.
    #
    # It would be nice to have them set in common runs.env[0] section, but it doesn't work[1]
    #
    # - [0] https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsenv
    # - [1] https://github.com/neondatabase/neon/pull/3907#discussion_r1154703456
    #
    - name: Set variables
      shell: bash -euxo pipefail {0}
      env:
        PR_NUMBER: ${{ github.event.pull_request.number }}
        BUCKET: neon-github-public-dev
      run: |
        if [ -n "${PR_NUMBER}" ]; then
          BRANCH_OR_PR=pr-${PR_NUMBER}
        elif [ "${GITHUB_REF_NAME}" = "main" ] || [ "${GITHUB_REF_NAME}" = "release" ] || \
             [ "${GITHUB_REF_NAME}" = "release-proxy" ] || [ "${GITHUB_REF_NAME}" = "release-compute" ]; then
          # Shortcut for special branches
          BRANCH_OR_PR=${GITHUB_REF_NAME}
        else
          BRANCH_OR_PR=branch-$(printf "${GITHUB_REF_NAME}" | tr -c "[:alnum:]._-" "-")
        fi

        LOCK_FILE=reports/${BRANCH_OR_PR}/lock.txt

        WORKDIR=/tmp/${BRANCH_OR_PR}-$(date +%s)
        mkdir -p ${WORKDIR}

        echo "BRANCH_OR_PR=${BRANCH_OR_PR}" >> $GITHUB_ENV
        echo "LOCK_FILE=${LOCK_FILE}"       >> $GITHUB_ENV
        echo "WORKDIR=${WORKDIR}"           >> $GITHUB_ENV
        echo "BUCKET=${BUCKET}"             >> $GITHUB_ENV

    # TODO: We can replace with a special docker image with Java and Allure pre-installed
    - uses: actions/setup-java@v4
      with:
        distribution: 'temurin'
        java-version: '17'

    - name: Install Allure
      shell: bash -euxo pipefail {0}
      working-directory: /tmp
      run: |
        if ! which allure; then
          ALLURE_ZIP=allure-${ALLURE_VERSION}.zip
          wget -q https://github.com/allure-framework/allure2/releases/download/${ALLURE_VERSION}/${ALLURE_ZIP}
          echo "${ALLURE_ZIP_SHA256} ${ALLURE_ZIP}" | sha256sum --check
          unzip -q ${ALLURE_ZIP}
          echo "$(pwd)/allure-${ALLURE_VERSION}/bin" >> $GITHUB_PATH
          rm -f ${ALLURE_ZIP}
        fi
      env:
        ALLURE_VERSION: 2.32.2
        ALLURE_ZIP_SHA256: 3f28885e2118f6317c92f667eaddcc6491400af1fb9773c1f3797a5fa5174953

    - uses: aws-actions/configure-aws-credentials@v4
      if: ${{ !cancelled() }}
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ inputs.aws-oidc-role-arn }}
        role-duration-seconds: 3600 # 1 hour should be more than enough to upload report

    # Potentially we could have several running build for the same key (for example, for the main branch), so we use improvised lock for this
    - name: Acquire lock
      shell: bash -euxo pipefail {0}
      run: |
        LOCK_TIMEOUT=300 # seconds

        LOCK_CONTENT="${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
        echo ${LOCK_CONTENT} > ${WORKDIR}/lock.txt

        # Do it up to 5 times to avoid race condition
        for _ in $(seq 1 5); do
          for i in $(seq 1 ${LOCK_TIMEOUT}); do
            LOCK_ACQUIRED=$(aws s3api head-object --bucket neon-github-public-dev --key ${LOCK_FILE} | jq --raw-output '.LastModified' || true)
            # `date --date="..."` is supported only by gnu date (i.e. it doesn't work on BSD/macOS)
            if [ -z "${LOCK_ACQUIRED}" ] || [ "$(( $(date +%s) - $(date --date="${LOCK_ACQUIRED}" +%s) ))" -gt "${LOCK_TIMEOUT}" ]; then
              break
            fi
            sleep 1
          done

          aws s3 mv --only-show-errors ${WORKDIR}/lock.txt "s3://${BUCKET}/${LOCK_FILE}"

          # Double-check that exactly THIS run has acquired the lock
          aws s3 cp --only-show-errors "s3://${BUCKET}/${LOCK_FILE}" ./lock.txt
          if [ "$(cat lock.txt)" = "${LOCK_CONTENT}" ]; then
            break
          fi
        done

    - name: Generate and publish final Allure report
      id: generate-report
      shell: bash -euxo pipefail {0}
      run: |
        REPORT_PREFIX=reports/${BRANCH_OR_PR}
        RAW_PREFIX=reports-raw/${BRANCH_OR_PR}/${GITHUB_RUN_ID}

        BASE_URL=https://${BUCKET}.s3.amazonaws.com/${REPORT_PREFIX}/${GITHUB_RUN_ID}
        BASE_S3_URL=s3://${BUCKET}/${REPORT_PREFIX}/${GITHUB_RUN_ID}
        REPORT_URL=${BASE_URL}/index.html
        REPORT_JSON_URL=${BASE_URL}/data/suites.json

        # Get previously uploaded data for this run
        ZSTD_NBTHREADS=0

        S3_FILEPATHS=$(aws s3api list-objects-v2 --bucket ${BUCKET} --prefix ${RAW_PREFIX}/ | jq --raw-output '.Contents[]?.Key')
        if [ -z "$S3_FILEPATHS" ]; then
          # There's no previously uploaded data for this $GITHUB_RUN_ID
          exit 0
        fi

        time aws s3 cp --recursive --only-show-errors "s3://${BUCKET}/${RAW_PREFIX}/" "${WORKDIR}/"
        for archive in $(find ${WORKDIR} -name "*.tar.zst"); do
          mkdir -p ${archive%.tar.zst}
          time tar -xf ${archive} -C ${archive%.tar.zst}
          rm -f ${archive}
        done

        # Get history trend
        time aws s3 cp --recursive --only-show-errors "s3://${BUCKET}/${REPORT_PREFIX}/latest/history" "${WORKDIR}/latest/history" || true

        # Generate report
        time allure generate --clean --output ${WORKDIR}/report ${WORKDIR}/*

        # Replace a logo link with a redirect to the latest version of the report
        sed -i 's|<a href="." class=|<a href="https://'${BUCKET}'.s3.amazonaws.com/'${REPORT_PREFIX}'/latest/index.html?nocache='"'+Date.now()+'"'" class=|g' ${WORKDIR}/report/app.js

        # Upload a history and the final report (in this particular order to not to have duplicated history in 2 places)
        time aws s3 mv --recursive --only-show-errors "${WORKDIR}/report/history" "s3://${BUCKET}/${REPORT_PREFIX}/latest/history"

        # Use aws s3 cp (instead of aws s3 sync) to keep files from previous runs to make old URLs work,
        # and to keep files on the host to upload them to the database
        time s5cmd --log error cp "${WORKDIR}/report/*" "s3://${BUCKET}/${REPORT_PREFIX}/${GITHUB_RUN_ID}/"

        # Generate redirect
        cat <<EOF > ${WORKDIR}/index.html
          <!DOCTYPE html>

          <meta charset="utf-8">
          <title>Redirecting to ${REPORT_URL}</title>
          <meta http-equiv="refresh" content="0; URL=${REPORT_URL}">
        EOF
        time aws s3 cp --only-show-errors ${WORKDIR}/index.html "s3://${BUCKET}/${REPORT_PREFIX}/latest/index.html"

        echo "base-url=${BASE_URL}"               >> $GITHUB_OUTPUT
        echo "base-s3-url=${BASE_S3_URL}"         >> $GITHUB_OUTPUT
        echo "report-url=${REPORT_URL}"           >> $GITHUB_OUTPUT
        echo "report-json-url=${REPORT_JSON_URL}" >> $GITHUB_OUTPUT

        echo "[Allure Report](${REPORT_URL})" >> ${GITHUB_STEP_SUMMARY}

    - name: Release lock
      if: always()
      shell: bash -euxo pipefail {0}
      run: |
        aws s3 cp --only-show-errors "s3://${BUCKET}/${LOCK_FILE}" ./lock.txt || exit 0

        if [ "$(cat lock.txt)" = "${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" ]; then
          aws s3 rm "s3://${BUCKET}/${LOCK_FILE}"
        fi

    - name: Cache poetry deps
      uses: actions/cache@v4
      with:
        path: ~/.cache/pypoetry/virtualenvs
        key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}

    - name: Store Allure test stat in the DB (new)
      if: ${{ !cancelled() && inputs.store-test-results-into-db == 'true' }}
      shell: bash -euxo pipefail {0}
      env:
        COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
        BASE_S3_URL: ${{ steps.generate-report.outputs.base-s3-url }}
      run: |
        if [ ! -d "${WORKDIR}/report/data/test-cases" ]; then
          exit 0
        fi

        export DATABASE_URL=${REGRESS_TEST_RESULT_CONNSTR_NEW}

        ./scripts/pysync

        poetry run python3 scripts/ingest_regress_test_result-new-format.py \
          --reference ${GITHUB_REF} \
          --revision ${COMMIT_SHA} \
          --run-id ${GITHUB_RUN_ID} \
          --run-attempt ${GITHUB_RUN_ATTEMPT} \
          --test-cases-dir ${WORKDIR}/report/data/test-cases

    - name: Cleanup
      if: always()
      shell: bash -euxo pipefail {0}
      run: |
        if [ -d "${WORKDIR}" ]; then
          rm -rf ${WORKDIR}
        fi

    - uses: actions/github-script@v7
      if: always()
      env:
        REPORT_URL: ${{ steps.generate-report.outputs.report-url }}
        COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
      with:
        # Retry script for 5XX server errors: https://github.com/actions/github-script#retries
        retries: 5
        script: |
          const { REPORT_URL, COMMIT_SHA } = process.env

          await github.rest.repos.createCommitStatus({
            owner: context.repo.owner,
            repo: context.repo.repo,
            sha: `${COMMIT_SHA}`,
            state: 'success',
            target_url: `${REPORT_URL}`,
            context: 'Allure report',
          })


================================================
FILE: .github/actions/allure-report-store/action.yml
================================================
name: 'Store Allure results'
description: 'Upload test results to be used by actions/allure-report-generate'

inputs:
  report-dir:
    description: 'directory with test results generated by tests'
    required: true
  unique-key:
    description: 'string to distinguish different results in the same run'
    required: true
  aws-oidc-role-arn:
    description: 'OIDC role arn to interract with S3'
    required: true

runs:
  using: "composite"

  steps:
    - name: Set variables
      shell: bash -euxo pipefail {0}
      env:
        PR_NUMBER: ${{ github.event.pull_request.number }}
        REPORT_DIR: ${{ inputs.report-dir }}
      run: |
        if [ -n "${PR_NUMBER}" ]; then
          BRANCH_OR_PR=pr-${PR_NUMBER}
        elif [ "${GITHUB_REF_NAME}" = "main" ] || [ "${GITHUB_REF_NAME}" = "release" ] || \
             [ "${GITHUB_REF_NAME}" = "release-proxy" ] || [ "${GITHUB_REF_NAME}" = "release-compute" ]; then
          # Shortcut for special branches
          BRANCH_OR_PR=${GITHUB_REF_NAME}
        else
          BRANCH_OR_PR=branch-$(printf "${GITHUB_REF_NAME}" | tr -c "[:alnum:]._-" "-")
        fi

        echo "BRANCH_OR_PR=${BRANCH_OR_PR}" >> $GITHUB_ENV
        echo "REPORT_DIR=${REPORT_DIR}"     >> $GITHUB_ENV

    - uses: aws-actions/configure-aws-credentials@v4
      if: ${{ !cancelled() }}
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ inputs.aws-oidc-role-arn }}
        role-duration-seconds: 3600 # 1 hour should be more than enough to upload report

    - name: Upload test results
      shell: bash -euxo pipefail {0}
      run: |
        REPORT_PREFIX=reports/${BRANCH_OR_PR}
        RAW_PREFIX=reports-raw/${BRANCH_OR_PR}/${GITHUB_RUN_ID}

        # Add metadata
        cat <<EOF > ${REPORT_DIR}/executor.json
          {
            "name": "GitHub Actions",
            "type": "github",
            "url": "https://${BUCKET}.s3.amazonaws.com/${REPORT_PREFIX}/latest/index.html",
            "buildOrder": ${GITHUB_RUN_ID},
            "buildName": "GitHub Actions Run #${GITHUB_RUN_NUMBER}/${GITHUB_RUN_ATTEMPT}",
            "buildUrl": "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}",
            "reportUrl": "https://${BUCKET}.s3.amazonaws.com/${REPORT_PREFIX}/${GITHUB_RUN_ID}/index.html",
            "reportName": "Allure Report"
          }
        EOF

        cat <<EOF > ${REPORT_DIR}/environment.properties
          COMMIT_SHA=${COMMIT_SHA}
        EOF

        ARCHIVE="${UNIQUE_KEY}-${GITHUB_RUN_ATTEMPT}-$(date +%s).tar.zst"
        ZSTD_NBTHREADS=0

        time tar -C ${REPORT_DIR} -cf ${ARCHIVE} --zstd .
        time aws s3 mv --only-show-errors ${ARCHIVE} "s3://${BUCKET}/${RAW_PREFIX}/${ARCHIVE}"
      env:
        UNIQUE_KEY: ${{ inputs.unique-key }}
        COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
        BUCKET: neon-github-public-dev

    - name: Cleanup
      if: always()
      shell: bash -euxo pipefail {0}
      run: |
        rm -rf ${REPORT_DIR}


================================================
FILE: .github/actions/download/action.yml
================================================
name: "Download an artifact"
description: "Custom download action"
inputs:
  name:
    description: "Artifact name"
    required: true
  path:
    description: "A directory to put artifact into"
    default: "."
    required: false
  skip-if-does-not-exist:
    description: "Allow to skip if file doesn't exist, fail otherwise"
    default: false
    required: false
  prefix:
    description: "S3 prefix. Default is '${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}'"
    required: false
  aws-oidc-role-arn:
    description: 'OIDC role arn to interract with S3'
    required: true

runs:
  using: "composite"
  steps:
    - uses: aws-actions/configure-aws-credentials@v4
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ inputs.aws-oidc-role-arn }}
        role-duration-seconds: 3600

    - name: Download artifact
      id: download-artifact
      shell: bash -euxo pipefail {0}
      env:
        TARGET: ${{ inputs.path }}
        ARCHIVE: /tmp/downloads/${{ inputs.name }}.tar.zst
        SKIP_IF_DOES_NOT_EXIST: ${{ inputs.skip-if-does-not-exist }}
        PREFIX: artifacts/${{ inputs.prefix || format('{0}/{1}/{2}', github.event.pull_request.head.sha || github.sha, github.run_id, github.run_attempt) }}
      run: |
        BUCKET=neon-github-public-dev
        FILENAME=$(basename $ARCHIVE)

        S3_KEY=$(aws s3api list-objects-v2 --bucket ${BUCKET} --prefix ${PREFIX%$GITHUB_RUN_ATTEMPT} | jq -r '.Contents[]?.Key' | grep ${FILENAME} | sort --version-sort | tail -1 || true)
        if [ -z "${S3_KEY}" ]; then
          if [ "${SKIP_IF_DOES_NOT_EXIST}" = "true" ]; then
            echo 'SKIPPED=true' >> $GITHUB_OUTPUT
            exit 0
          else
            echo >&2 "Neither s3://${BUCKET}/${PREFIX}/${FILENAME} nor its version from previous attempts exist"
            exit 1
          fi
        fi

        echo 'SKIPPED=false' >> $GITHUB_OUTPUT

        mkdir -p $(dirname $ARCHIVE)
        time aws s3 cp --only-show-errors s3://${BUCKET}/${S3_KEY} ${ARCHIVE}

    - name: Extract artifact
      if: ${{ steps.download-artifact.outputs.SKIPPED == 'false' }}
      shell: bash -euxo pipefail {0}
      env:
        TARGET: ${{ inputs.path }}
        ARCHIVE: /tmp/downloads/${{ inputs.name }}.tar.zst
      run: |
        mkdir -p ${TARGET}
        time tar -xf ${ARCHIVE} -C ${TARGET}
        rm -f ${ARCHIVE}


================================================
FILE: .github/actions/neon-branch-create/action.yml
================================================
name: 'Create Branch'
description: 'Create Branch using API'

inputs:
  api_key:
    description: 'Neon API key'
    required: true
  project_id:
    description: 'ID of the Project to create Branch in'
    required: true
  api_host:
    description: 'Neon API host'
    default: console-stage.neon.build
outputs:
  dsn:
    description: 'Created Branch DSN (for main database)'
    value: ${{ steps.change-password.outputs.dsn }}
  branch_id:
    description: 'Created Branch ID'
    value: ${{ steps.create-branch.outputs.branch_id }}

runs:
  using: "composite"
  steps:
    - name: Create New Branch
      id: create-branch
      shell: bash -euxo pipefail {0}
      run: |
        for i in $(seq 1 10); do
         branch=$(curl \
            "https://${API_HOST}/api/v2/projects/${PROJECT_ID}/branches" \
            --header "Accept: application/json" \
            --header "Content-Type: application/json" \
            --header "Authorization: Bearer ${API_KEY}" \
            --data "{
              \"branch\": {
                \"name\": \"Created by actions/neon-branch-create; GITHUB_RUN_ID=${GITHUB_RUN_ID} at $(date +%s)\"
              },
              \"endpoints\": [
                {
                  \"type\": \"read_write\"
                }
              ]
            }")

          if [ -z "${branch}" ]; then
            sleep 1
            continue
          fi

          branch_id=$(echo $branch | jq --raw-output '.branch.id')
          if [ "${branch_id}" == "null" ]; then
            sleep 1
            continue
          fi

          break
        done

        if [ -z "${branch_id}" ] || [ "${branch_id}" == "null" ]; then
          echo >&2 "Failed to create branch after 10 attempts, the latest response was: ${branch}"
          exit 1
        fi

        branch_id=$(echo $branch | jq --raw-output '.branch.id')
        echo "branch_id=${branch_id}" >> $GITHUB_OUTPUT

        host=$(echo $branch | jq --raw-output '.endpoints[0].host')
        echo "host=${host}" >> $GITHUB_OUTPUT
      env:
        API_HOST: ${{ inputs.api_host }}
        API_KEY: ${{ inputs.api_key }}
        PROJECT_ID: ${{ inputs.project_id }}

    - name: Get Role name
      id: role-name
      shell: bash -euxo pipefail {0}
      run: |
        roles=$(curl \
          "https://${API_HOST}/api/v2/projects/${PROJECT_ID}/branches/${BRANCH_ID}/roles" \
          --fail \
          --header "Accept: application/json" \
          --header "Content-Type: application/json" \
          --header "Authorization: Bearer ${API_KEY}"
          )

        role_name=$(echo "$roles" | jq --raw-output '
          (.roles | map(select(.protected == false))) as $roles |
          if any($roles[]; .name == "neondb_owner")
          then "neondb_owner"
          else $roles[0].name
          end
        ')
        echo "role_name=${role_name}" >> $GITHUB_OUTPUT
      env:
        API_HOST: ${{ inputs.api_host }}
        API_KEY: ${{ inputs.api_key }}
        PROJECT_ID: ${{ inputs.project_id }}
        BRANCH_ID: ${{ steps.create-branch.outputs.branch_id }}

    - name: Change Password
      id: change-password
      # A shell without `set -x` to not to expose password/dsn in logs
      shell: bash -euo pipefail {0}
      run: |
        for i in $(seq 1 10); do
          reset_password=$(curl \
            "https://${API_HOST}/api/v2/projects/${PROJECT_ID}/branches/${BRANCH_ID}/roles/${ROLE_NAME}/reset_password" \
            --request POST \
            --header "Accept: application/json" \
            --header "Content-Type: application/json" \
            --header "Authorization: Bearer ${API_KEY}"
            )

          if [ -z "${reset_password}" ]; then
            sleep $i
            continue
          fi

          password=$(echo $reset_password | jq --raw-output '.role.password')
          if [ "${password}" == "null" ]; then
            sleep $i # increasing backoff
            continue
          fi

          echo "::add-mask::${password}"
          break
        done

        if [ -z "${password}" ] || [ "${password}" == "null" ]; then
          echo >&2 "Failed to reset password after 10 attempts, the latest response was: ${reset_password}"
          exit 1
        fi

        dsn="postgres://${ROLE_NAME}:${password}@${HOST}/neondb"
        echo "::add-mask::${dsn}"
        echo "dsn=${dsn}" >> $GITHUB_OUTPUT
      env:
        API_HOST: ${{ inputs.api_host }}
        API_KEY: ${{ inputs.api_key }}
        PROJECT_ID: ${{ inputs.project_id }}
        BRANCH_ID: ${{ steps.create-branch.outputs.branch_id }}
        ROLE_NAME: ${{ steps.role-name.outputs.role_name }}
        HOST: ${{ steps.create-branch.outputs.host }}


================================================
FILE: .github/actions/neon-branch-delete/action.yml
================================================
name: 'Delete Branch'
description: 'Delete Branch using API'

inputs:
  api_key:
    description: 'Neon API key'
    required: true
  project_id:
    description: 'ID of the Project which should be deleted'
    required: true
  branch_id:
    description: 'ID of the branch to delete'
    required: true
  api_host:
    description: 'Neon API host'
    default: console-stage.neon.build

runs:
  using: "composite"
  steps:
    - name: Delete Branch
      # Do not try to delete a branch if .github/actions/neon-project-create
      # or .github/actions/neon-branch-create failed before
      if: ${{ inputs.project_id != '' && inputs.branch_id != '' }}
      shell: bash -euxo pipefail {0}
      run: |
        for i in $(seq 1 10); do
          deleted_branch=$(curl \
            "https://${API_HOST}/api/v2/projects/${PROJECT_ID}/branches/${BRANCH_ID}" \
            --request DELETE \
            --header "Accept: application/json" \
            --header "Content-Type: application/json" \
            --header "Authorization: Bearer ${API_KEY}"
            )

          if [ -z "${deleted_branch}" ]; then
            sleep 1
            continue
          fi

          branch_id=$(echo $deleted_branch | jq --raw-output '.branch.id')
          if [ "${branch_id}" == "null" ]; then
            sleep 1
            continue
          fi

          break
        done

        if [ -z "${branch_id}" ] || [ "${branch_id}" == "null" ]; then
          echo >&2 "Failed to delete branch after 10 attempts, the latest response was: ${deleted_branch}"
          exit 1
        fi
      env:
        API_HOST: ${{ inputs.api_host }}
        API_KEY: ${{ inputs.api_key }}
        PROJECT_ID: ${{ inputs.project_id }}
        BRANCH_ID: ${{ inputs.branch_id }}


================================================
FILE: .github/actions/neon-project-create/action.yml
================================================
name: 'Create Neon Project'
description: 'Create Neon Project using API'

inputs:
  api_key:
    description: 'Neon API key'
    required: true
  region_id:
    description: 'Region ID, if not set the project will be created in the default region'
    default: aws-us-east-2
  postgres_version:
    description: 'Postgres version; default is 16'
    default: '16'
  api_host:
    description: 'Neon API host'
    default: console-stage.neon.build
  compute_units:
    description: '[Min, Max] compute units'
    default: '[1, 1]'
  # settings below only needed if you want the project to be sharded from the beginning
  shard_split_project:
    description: 'by default new projects are not shard-split initiailly, but only when shard-split threshold is reached, specify true to explicitly shard-split initially'
    required: false
    default: 'false'
  disable_sharding:
    description: 'by default new projects use storage controller default policy to shard-split when shard-split threshold is reached, specify true to explicitly disable sharding'
    required: false
    default: 'false'
  admin_api_key:
    description: 'Admin API Key needed for shard-splitting. Must be specified if shard_split_project is true'
    required: false
  shard_count:
    description: 'Number of shards to split the project into, only applies if shard_split_project is true'
    required: false
    default: '8'
  stripe_size:
    description: 'Stripe size, optional, in 8kiB pages.  e.g. set 2048 for 16MB stripes. Default is 128 MiB, only applies if shard_split_project is true'
    required: false
    default: '32768'
  psql_path:
    description: 'Path to psql binary - it is caller responsibility to provision the psql binary'
    required: false
    default: '/tmp/neon/pg_install/v16/bin/psql'
  libpq_lib_path:
    description: 'Path to directory containing libpq library - it is caller responsibility to provision the libpq library'
    required: false
    default: '/tmp/neon/pg_install/v16/lib'
  project_settings:
    description: 'A JSON object with project settings'
    required: false
    default: '{}'

outputs:
  dsn:
    description: 'Created Project DSN (for main database)'
    value: ${{ steps.create-neon-project.outputs.dsn }}
  project_id:
    description: 'Created Project ID'
    value: ${{ steps.create-neon-project.outputs.project_id }}

runs:
  using: "composite"
  steps:
    - name: Create Neon Project
      id: create-neon-project
      # A shell without `set -x` to not to expose password/dsn in logs
      shell: bash -euo pipefail {0}
      run: |
        res=$(curl \
          "https://${API_HOST}/api/v2/projects" \
          -w "%{http_code}" \
          --header "Accept: application/json" \
          --header "Content-Type: application/json" \
          --header "Authorization: Bearer ${API_KEY}" \
          --data "{
            \"project\": {
              \"name\": \"Created by actions/neon-project-create; GITHUB_RUN_ID=${GITHUB_RUN_ID}\",
              \"pg_version\": ${POSTGRES_VERSION},
              \"region_id\": \"${REGION_ID}\",
              \"provisioner\": \"k8s-neonvm\",
              \"autoscaling_limit_min_cu\": ${MIN_CU},
              \"autoscaling_limit_max_cu\": ${MAX_CU},
              \"settings\": ${PROJECT_SETTINGS}
            }
          }")
        
        code=${res: -3}
        if [[ ${code} -ge 400 ]]; then
          echo Request failed with error code ${code}
          echo ${res::-3}
          exit 1
        else
          project=${res::-3}
        fi

        # Mask password
        echo "::add-mask::$(echo $project | jq --raw-output '.roles[] | select(.name != "web_access") | .password')"

        dsn=$(echo $project | jq --raw-output '.connection_uris[0].connection_uri')
        echo "::add-mask::${dsn}"
        echo "dsn=${dsn}" >> $GITHUB_OUTPUT

        project_id=$(echo $project | jq --raw-output '.project.id')
        echo "project_id=${project_id}" >> $GITHUB_OUTPUT

        echo "Project ${project_id} has been created"

        if [ "${SHARD_SPLIT_PROJECT}" = "true" ]; then
          # determine tenant ID
          TENANT_ID=`${PSQL} ${dsn} -t -A -c "SHOW neon.tenant_id"`

          echo "Splitting project ${project_id} with tenant_id ${TENANT_ID} into $((SHARD_COUNT)) shards with stripe size $((STRIPE_SIZE))"

          echo "Sending PUT request to https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/shard_split"
          echo "with body {\"new_shard_count\": $((SHARD_COUNT)), \"new_stripe_size\": $((STRIPE_SIZE))}"

          # we need an ADMIN API KEY to invoke storage controller API for shard splitting (bash -u above checks that the variable is set)
          curl -X PUT \
            "https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/shard_split" \
            -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer ${ADMIN_API_KEY}" \
            -d "{\"new_shard_count\": $SHARD_COUNT, \"new_stripe_size\": $STRIPE_SIZE}"
        fi
        if [ "${DISABLE_SHARDING}" = "true" ]; then
          # determine tenant ID
          TENANT_ID=`${PSQL} ${dsn} -t -A -c "SHOW neon.tenant_id"`

          echo "Explicitly disabling shard-splitting for project ${project_id} with tenant_id ${TENANT_ID}"

          echo "Sending PUT request to https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/policy"
          echo "with body {\"scheduling\": \"Essential\"}"

          # we need an ADMIN API KEY to invoke storage controller API for shard splitting (bash -u above checks that the variable is set)
          curl -X PUT \
            "https://${API_HOST}/regions/${REGION_ID}/api/v1/admin/storage/proxy/control/v1/tenant/${TENANT_ID}/policy" \
            -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer ${ADMIN_API_KEY}" \
            -d "{\"scheduling\": \"Essential\"}"
        fi
        

      env:
        API_HOST: ${{ inputs.api_host }}
        API_KEY: ${{ inputs.api_key }}
        REGION_ID: ${{ inputs.region_id }}
        POSTGRES_VERSION: ${{ inputs.postgres_version }}
        MIN_CU: ${{ fromJSON(inputs.compute_units)[0] }}
        MAX_CU: ${{ fromJSON(inputs.compute_units)[1] }}
        SHARD_SPLIT_PROJECT: ${{ inputs.shard_split_project }}
        DISABLE_SHARDING: ${{ inputs.disable_sharding }}
        ADMIN_API_KEY: ${{ inputs.admin_api_key }}
        SHARD_COUNT: ${{ inputs.shard_count }}
        STRIPE_SIZE: ${{ inputs.stripe_size }}
        PSQL: ${{ inputs.psql_path }}
        LD_LIBRARY_PATH: ${{ inputs.libpq_lib_path }}
        PROJECT_SETTINGS: ${{ inputs.project_settings }}


================================================
FILE: .github/actions/neon-project-delete/action.yml
================================================
name: 'Delete Neon Project'
description: 'Delete Neon Project using API'

inputs:
  api_key:
    description: 'Neon API key'
    required: true
  project_id:
    description: 'ID of the Project to delete'
    required: true
  api_host:
    description: 'Neon API host'
    default: console-stage.neon.build

runs:
  using: "composite"
  steps:
    - name: Delete Neon Project
      # Do not try to delete a project if .github/actions/neon-project-create failed before
      if: ${{ inputs.project_id != '' }}
      shell: bash -euxo pipefail {0}
      run: |
        curl \
          "https://${API_HOST}/api/v2/projects/${PROJECT_ID}" \
          --fail \
          --request DELETE \
          --header "Accept: application/json" \
          --header "Content-Type: application/json" \
          --header "Authorization: Bearer ${API_KEY}"

        echo "Project ${PROJECT_ID} has been deleted"
      env:
        API_HOST: ${{ inputs.api_host }}
        API_KEY: ${{ inputs.api_key }}
        PROJECT_ID: ${{ inputs.project_id }}


================================================
FILE: .github/actions/prepare-for-subzero/action.yml
================================================
name: 'Prepare current job for subzero'
description: >
  Set git token to access `neondatabase/subzero` from cargo build,
  and set `CARGO_NET_GIT_FETCH_WITH_CLI=true` env variable to use git CLI

inputs:
  token:
    description: 'GitHub token with access to neondatabase/subzero'
    required: true

runs:
  using: "composite"

  steps:
    - name: Set git token for neondatabase/subzero
      uses: pyTooling/Actions/with-post-step@2307b526df64d55e95884e072e49aac2a00a9afa # v5.1.0
      env:
        SUBZERO_ACCESS_TOKEN: ${{ inputs.token }}
      with:
        main: |
          git config --global url."https://x-access-token:${SUBZERO_ACCESS_TOKEN}@github.com/neondatabase/subzero".insteadOf "https://github.com/neondatabase/subzero"
          cargo add -p proxy subzero-core --git https://github.com/neondatabase/subzero --rev 396264617e78e8be428682f87469bb25429af88a
        post: |
          git config --global --unset url."https://x-access-token:${SUBZERO_ACCESS_TOKEN}@github.com/neondatabase/subzero".insteadOf "https://github.com/neondatabase/subzero"

    - name: Set `CARGO_NET_GIT_FETCH_WITH_CLI=true` env variable
      shell: bash -euxo pipefail {0}
      run: echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> ${GITHUB_ENV}


================================================
FILE: .github/actions/run-python-test-set/action.yml
================================================
name: 'Run python test'
description: 'Runs a Neon python test set, performing all the required preparations before'

inputs:
  build_type:
    description: 'Type of Rust (neon) and C (postgres) builds. Must be "release" or "debug", or "remote" for the remote cluster'
    required: true
  test_selection:
    description: 'A python test suite to run'
    required: true
  extra_params:
    description: 'Arbitrary parameters to pytest. For example "-s" to prevent capturing stdout/stderr'
    required: false
    default: ''
  needs_postgres_source:
    description: 'Set to true if the test suite requires postgres source checked out'
    required: false
    default: 'false'
  run_in_parallel:
    description: 'Whether to run tests in parallel'
    required: false
    default: 'true'
  save_perf_report:
    description: 'Whether to upload the performance report, if true PERF_TEST_RESULT_CONNSTR env variable should be set'
    required: false
    default: 'false'
  run_with_real_s3:
    description: 'Whether to pass real s3 credentials to the test suite'
    required: false
    default: 'false'
  real_s3_bucket:
    description: 'Bucket name for real s3 tests'
    required: false
    default: ''
  real_s3_region:
    description: 'Region name for real s3 tests'
    required: false
    default: ''
  rerun_failed:
    description: 'Whether to rerun failed tests'
    required: false
    default: 'false'
  pg_version:
    description: 'Postgres version to use for tests'
    required: false
    default: 'v16'
  sanitizers:
    description: 'enabled or disabled'
    required: false
    default: 'disabled'
    type: string
  benchmark_durations:
    description: 'benchmark durations JSON'
    required: false
    default: '{}'
  aws-oidc-role-arn:
    description: 'OIDC role arn to interract with S3'
    required: true

runs:
  using: "composite"
  steps:
    - name: Get Neon artifact
      if: inputs.build_type != 'remote'
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build_type }}${{ inputs.sanitizers == 'enabled' && '-sanitized' || '' }}-artifact
        path: /tmp/neon
        aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}

    - name: Download Neon binaries for the previous release
      if: inputs.build_type != 'remote'
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build_type }}-artifact
        path: /tmp/neon-previous
        prefix: latest
        aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}

    - name: Download compatibility snapshot
      if: inputs.build_type != 'remote'
      uses: ./.github/actions/download
      with:
        name: compatibility-snapshot-${{ runner.arch }}-${{ inputs.build_type }}-pg${{ inputs.pg_version }}
        path: /tmp/compatibility_snapshot_pg${{ inputs.pg_version }}
        prefix: latest
        # The lack of compatibility snapshot (for example, for the new Postgres version)
        # shouldn't fail the whole job. Only relevant test should fail.
        skip-if-does-not-exist: true
        aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}

    - name: Checkout
      if: inputs.needs_postgres_source == 'true'
      uses: actions/checkout@v4
      with:
        submodules: true

    - name: Cache poetry deps
      uses: actions/cache@v4
      with:
        path: ~/.cache/pypoetry/virtualenvs
        key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}

    - name: Install Python deps
      shell: bash -euxo pipefail {0}
      run: ./scripts/pysync

    - name: Run pytest
      env:
        NEON_BIN: /tmp/neon/bin
        COMPATIBILITY_NEON_BIN: /tmp/neon-previous/bin
        COMPATIBILITY_POSTGRES_DISTRIB_DIR: /tmp/neon-previous/pg_install
        TEST_OUTPUT: /tmp/test_output
        BUILD_TYPE: ${{ inputs.build_type }}
        COMPATIBILITY_SNAPSHOT_DIR: /tmp/compatibility_snapshot_pg${{ inputs.pg_version }}
        RERUN_FAILED: ${{ inputs.rerun_failed }}
        PG_VERSION: ${{ inputs.pg_version }}
        SANITIZERS: ${{ inputs.sanitizers }}
      shell: bash -euxo pipefail {0}
      run: |
        # PLATFORM will be embedded in the perf test report
        # and it is needed to distinguish different environments
        export PLATFORM=${PLATFORM:-github-actions-selfhosted}
        export POSTGRES_DISTRIB_DIR=${POSTGRES_DISTRIB_DIR:-/tmp/neon/pg_install}
        export DEFAULT_PG_VERSION=${PG_VERSION#v}
        export LD_LIBRARY_PATH=${POSTGRES_DISTRIB_DIR}/v${DEFAULT_PG_VERSION}/lib
        export BENCHMARK_CONNSTR=${BENCHMARK_CONNSTR:-}
        export ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=0:abort_on_error=1:strict_string_checks=1:check_initialization_order=1:strict_init_order=1
        export UBSAN_OPTIONS=abort_on_error=1:print_stacktrace=1

        if [ "${BUILD_TYPE}" = "remote" ]; then
          export REMOTE_ENV=1
        fi

        PERF_REPORT_DIR="$(realpath test_runner/perf-report-local)"
        echo "PERF_REPORT_DIR=${PERF_REPORT_DIR}" >> ${GITHUB_ENV}
        rm -rf $PERF_REPORT_DIR

        TEST_SELECTION="test_runner/${{ inputs.test_selection }}"
        EXTRA_PARAMS="${{ inputs.extra_params }}"
        if [ -z "$TEST_SELECTION" ]; then
          echo "test_selection must be set"
          exit 1
        fi
        if [[ "${{ inputs.run_in_parallel }}" == "true" ]]; then
          # -n sets the number of parallel processes that pytest-xdist will run
          EXTRA_PARAMS="-n12 $EXTRA_PARAMS"

          # --dist=loadgroup points tests marked with @pytest.mark.xdist_group
          # to the same worker to make @pytest.mark.order work with xdist
          EXTRA_PARAMS="--dist=loadgroup $EXTRA_PARAMS"
        fi

        if [[ "${{ inputs.run_with_real_s3 }}" == "true" ]]; then
          echo "REAL S3 ENABLED"
          export ENABLE_REAL_S3_REMOTE_STORAGE=nonempty
          export REMOTE_STORAGE_S3_BUCKET=${{ inputs.real_s3_bucket }}
          export REMOTE_STORAGE_S3_REGION=${{ inputs.real_s3_region }}
        fi

        if [[ "${{ inputs.save_perf_report }}" == "true" ]]; then
          mkdir -p "$PERF_REPORT_DIR"
          EXTRA_PARAMS="--out-dir $PERF_REPORT_DIR $EXTRA_PARAMS"
        fi

        if [ "${RERUN_FAILED}" == "true" ]; then
          EXTRA_PARAMS="--reruns 2 $EXTRA_PARAMS"
        fi

        # We use pytest-split plugin to run benchmarks in parallel on different CI runners
        if [ "${TEST_SELECTION}" = "test_runner/performance" ] && [ "${{ inputs.build_type }}" != "remote" ]; then
          mkdir -p $TEST_OUTPUT
          echo '${{ inputs.benchmark_durations || '{}' }}' > $TEST_OUTPUT/benchmark_durations.json

          EXTRA_PARAMS="--durations-path $TEST_OUTPUT/benchmark_durations.json $EXTRA_PARAMS"
        fi

        if [[ $BUILD_TYPE == "debug" && $RUNNER_ARCH == 'X64' ]]; then
          # We don't use code coverage for regression tests (the step is disabled),
          # so there's no need to collect it.
          # Ref https://github.com/neondatabase/neon/issues/4540
          # cov_prefix=(scripts/coverage "--profraw-prefix=$GITHUB_JOB" --dir=/tmp/coverage run)
          cov_prefix=()
          # Explicitly set LLVM_PROFILE_FILE to /dev/null to avoid writing *.profraw files
          export LLVM_PROFILE_FILE=/dev/null
        else
          cov_prefix=()
        fi

        # Wake up the cluster if we use remote neon instance
        if [ "${{ inputs.build_type }}" = "remote" ] && [ -n "${BENCHMARK_CONNSTR}" ]; then
          QUERIES=("SELECT version()")
          if [[ "${PLATFORM}" = "neon"* ]]; then
            QUERIES+=("SHOW neon.tenant_id")
            QUERIES+=("SHOW neon.timeline_id")
          fi

          for q in "${QUERIES[@]}"; do
            ${POSTGRES_DISTRIB_DIR}/v${DEFAULT_PG_VERSION}/bin/psql ${BENCHMARK_CONNSTR} -c "${q}"
          done
        fi

        # Run the tests.
        #
        # --alluredir saves test results in Allure format (in a specified directory)
        # --verbose prints name of each test (helpful when there are
        # multiple tests in one file)
        # -rA prints summary in the end
        # -s is not used to prevent pytest from capturing output, because tests are running
        # in parallel and logs are mixed between different tests
        #
        mkdir -p $TEST_OUTPUT/allure/results
        "${cov_prefix[@]}" ./scripts/pytest \
          --alluredir=$TEST_OUTPUT/allure/results \
          --tb=short \
          --verbose \
          -rA $TEST_SELECTION $EXTRA_PARAMS

    - name: Upload performance report
      if: ${{ !cancelled() && inputs.save_perf_report == 'true' }}
      shell: bash -euxo pipefail {0}
      run: |
        export REPORT_FROM="${PERF_REPORT_DIR}"
        scripts/generate_and_push_perf_report.sh

    - name: Upload compatibility snapshot
      # Note, that we use `github.base_ref` which is a target branch for a PR
      if: github.event_name == 'pull_request' && github.base_ref == 'release'
      uses: ./.github/actions/upload
      with:
        name: compatibility-snapshot-${{ runner.arch }}-${{ inputs.build_type }}-pg${{ inputs.pg_version }}
        # Directory is created by test_compatibility.py::test_create_snapshot, keep the path in sync with the test
        path: /tmp/test_output/compatibility_snapshot_pg${{ inputs.pg_version }}/
        # The lack of compatibility snapshot shouldn't fail the job
        # (for example if we didn't run the test for non build-and-test workflow)
        skip-if-does-not-exist: true
        aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}

    - uses: aws-actions/configure-aws-credentials@v4
      if: ${{ !cancelled() }}
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ inputs.aws-oidc-role-arn }}
        role-duration-seconds: 3600 # 1 hour should be more than enough to upload report

    - name: Upload test results
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-store
      with:
        report-dir: /tmp/test_output/allure/results
        unique-key: ${{ inputs.build_type }}-${{ inputs.pg_version }}-${{ runner.arch }}
        aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}


================================================
FILE: .github/actions/save-coverage-data/action.yml
================================================
name: 'Merge and upload coverage data'
description: 'Compresses and uploads the coverage data as an artifact'

runs:
  using: "composite"
  steps:
    - name: Merge coverage data
      shell: bash -euxo pipefail {0}
      run: scripts/coverage "--profraw-prefix=$GITHUB_JOB" --dir=/tmp/coverage merge

    - name: Download previous coverage data into the same directory
      uses: ./.github/actions/download
      with:
        name: coverage-data-artifact
        path: /tmp/coverage
        skip-if-does-not-exist: true # skip if there's no previous coverage to download
        aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}

    - name: Upload coverage data
      uses: ./.github/actions/upload
      with:
        name: coverage-data-artifact
        path: /tmp/coverage
        aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}


================================================
FILE: .github/actions/upload/action.yml
================================================
name: "Upload an artifact"
description: "Custom upload action"
inputs:
  name:
    description: "Artifact name"
    required: true
  path:
    description: "A directory or file to upload"
    required: true
  skip-if-does-not-exist:
    description: "Allow to skip if path doesn't exist, fail otherwise"
    default: false
    required: false
  prefix:
    description: "S3 prefix. Default is '${GITHUB_SHA}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}'"
    required: false
  aws-oidc-role-arn:
    description: "the OIDC role arn for aws auth"
    required: false
    default: ""

runs:
  using: "composite"
  steps:
    - name: Prepare artifact
      id: prepare-artifact
      shell: bash -euxo pipefail {0}
      env:
        SOURCE: ${{ inputs.path }}
        ARCHIVE: /tmp/uploads/${{ inputs.name }}.tar.zst
        SKIP_IF_DOES_NOT_EXIST: ${{ inputs.skip-if-does-not-exist }}
      run: |
        mkdir -p $(dirname $ARCHIVE)

        if [ -f ${ARCHIVE} ]; then
          echo >&2 "File ${ARCHIVE} already exist. Something went wrong before"
          exit 1
        fi

        ZSTD_NBTHREADS=0
        if [ -d  ${SOURCE} ]; then
          time tar -C ${SOURCE} -cf ${ARCHIVE} --zstd .
        elif [ -f ${SOURCE} ]; then
          time tar -cf ${ARCHIVE} --zstd ${SOURCE}
        elif ! ls ${SOURCE} > /dev/null 2>&1; then
          if [ "${SKIP_IF_DOES_NOT_EXIST}" = "true" ]; then
            echo 'SKIPPED=true' >> $GITHUB_OUTPUT
            exit 0
          else
            echo >&2 "${SOURCE} does not exist"
            exit 2
          fi
        else
          echo >&2 "${SOURCE} is neither a directory nor a file, do not know how to handle it"
          exit 3
        fi

        echo 'SKIPPED=false' >> $GITHUB_OUTPUT

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@v4
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ inputs.aws-oidc-role-arn }}
        role-duration-seconds: 3600

    - name: Upload artifact
      if: ${{ steps.prepare-artifact.outputs.SKIPPED == 'false' }}
      shell: bash -euxo pipefail {0}
      env:
        SOURCE: ${{ inputs.path }}
        ARCHIVE: /tmp/uploads/${{ inputs.name }}.tar.zst
        PREFIX: artifacts/${{ inputs.prefix || format('{0}/{1}/{2}', github.event.pull_request.head.sha || github.sha, github.run_id , github.run_attempt) }}
      run: |
        BUCKET=neon-github-public-dev
        FILENAME=$(basename $ARCHIVE)

        FILESIZE=$(du -sh ${ARCHIVE} | cut -f1)

        time aws s3 mv --only-show-errors ${ARCHIVE} s3://${BUCKET}/${PREFIX}/${FILENAME}

        # Ref https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary
        echo "[${FILENAME}](https://${BUCKET}.s3.amazonaws.com/${PREFIX}/${FILENAME}) ${FILESIZE}" >> ${GITHUB_STEP_SUMMARY}


================================================
FILE: .github/file-filters.yaml
================================================
rust_code: ['**/*.rs', '**/Cargo.toml', '**/Cargo.lock']
rust_dependencies: ['**/Cargo.lock']

v14: ['vendor/postgres-v14/**', 'Makefile', 'pgxn/**']
v15: ['vendor/postgres-v15/**', 'Makefile', 'pgxn/**']
v16: ['vendor/postgres-v16/**', 'Makefile', 'pgxn/**']
v17: ['vendor/postgres-v17/**', 'Makefile', 'pgxn/**']

rebuild_neon_extra:
    - .github/workflows/neon_extra_builds.yml

rebuild_macos:
    - .github/workflows/build-macos.yml


================================================
FILE: .github/pull_request_template.md
================================================
## Problem

## Summary of changes


================================================
FILE: .github/scripts/generate_image_maps.py
================================================
import itertools
import json
import os
import sys

source_tag = os.getenv("SOURCE_TAG")
target_tag = os.getenv("TARGET_TAG")
branch = os.getenv("BRANCH")
dev_acr = os.getenv("DEV_ACR")
prod_acr = os.getenv("PROD_ACR")
dev_aws = os.getenv("DEV_AWS")
prod_aws = os.getenv("PROD_AWS")
aws_region = os.getenv("AWS_REGION")

components = {
    "neon": ["neon"],
    "compute": [
        "compute-node-v14",
        "compute-node-v15",
        "compute-node-v16",
        "compute-node-v17",
        "vm-compute-node-v14",
        "vm-compute-node-v15",
        "vm-compute-node-v16",
        "vm-compute-node-v17",
    ],
}

registries = {
    "dev": [
        "docker.io/neondatabase",
        "ghcr.io/neondatabase",
        f"{dev_aws}.dkr.ecr.{aws_region}.amazonaws.com",
        f"{dev_acr}.azurecr.io/neondatabase",
    ],
    "prod": [
        f"{prod_aws}.dkr.ecr.{aws_region}.amazonaws.com",
        f"{prod_acr}.azurecr.io/neondatabase",
    ],
}

release_branches = ["release", "release-proxy", "release-compute"]

outputs: dict[str, dict[str, list[str]]] = {}

target_tags = (
    [target_tag, "latest"]
    if branch == "main"
    else [target_tag, "released"]
    if branch in release_branches
    else [target_tag]
)
target_stages = ["dev", "prod"] if branch in release_branches else ["dev"]

for component_name, component_images in components.items():
    for stage in target_stages:
        outputs[f"{component_name}-{stage}"] = {
            f"ghcr.io/neondatabase/{component_image}:{source_tag}": [
                f"{registry}/{component_image}:{tag}"
                for registry, tag in itertools.product(registries[stage], target_tags)
                if not (registry == "ghcr.io/neondatabase" and tag == source_tag)
            ]
            for component_image in component_images
        }

with open(os.getenv("GITHUB_OUTPUT", "/dev/null"), "a") as f:
    for key, value in outputs.items():
        f.write(f"{key}={json.dumps(value)}\n")
        print(f"Image map for {key}:\n{json.dumps(value, indent=2)}\n\n", file=sys.stderr)


================================================
FILE: .github/scripts/lint-release-pr.sh
================================================
#!/usr/bin/env bash

set -euo pipefail

DOCS_URL="https://docs.neon.build/overview/repositories/neon.html"

message() {
  if [[ -n "${GITHUB_PR_NUMBER:-}" ]]; then
    gh pr comment --repo "${GITHUB_REPOSITORY}" "${GITHUB_PR_NUMBER}" --edit-last --body "$1" \
      || gh pr comment --repo "${GITHUB_REPOSITORY}" "${GITHUB_PR_NUMBER}" --body "$1"
  fi
  echo "$1"
}

report_error() {
  message "❌ $1
  For more details, see the documentation: ${DOCS_URL}"

  exit 1
}

case "$RELEASE_BRANCH" in
  "release") COMPONENT="Storage" ;;
  "release-proxy") COMPONENT="Proxy" ;;
  "release-compute") COMPONENT="Compute" ;;
  *)
    report_error "Unknown release branch: ${RELEASE_BRANCH}"
    ;;
esac


# Identify main and release branches
MAIN_BRANCH="origin/main"
REMOTE_RELEASE_BRANCH="origin/${RELEASE_BRANCH}"

# Find merge base
MERGE_BASE=$(git merge-base "${MAIN_BRANCH}" "${REMOTE_RELEASE_BRANCH}")
echo "Merge base of ${MAIN_BRANCH} and ${RELEASE_BRANCH}: ${MERGE_BASE}"

# Get the HEAD commit (last commit in PR, expected to be the merge commit)
LAST_COMMIT=$(git rev-parse HEAD)

MERGE_COMMIT_MESSAGE=$(git log -1 --format=%s "${LAST_COMMIT}")
EXPECTED_MESSAGE_REGEX="^$COMPONENT release [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2} UTC$"

if ! [[ "${MERGE_COMMIT_MESSAGE}" =~ ${EXPECTED_MESSAGE_REGEX} ]]; then
  report_error "Merge commit message does not match expected pattern: '<component> release YYYY-MM-DD'
  Expected component: ${COMPONENT}
  Found: '${MERGE_COMMIT_MESSAGE}'"
fi
echo "✅ Merge commit message is correctly formatted: '${MERGE_COMMIT_MESSAGE}'"

LAST_COMMIT_PARENTS=$(git cat-file -p "${LAST_COMMIT}" | jq -sR '[capture("parent (?<parent>[0-9a-f]{40})"; "g") | .parent]')

if [[ "$(echo "${LAST_COMMIT_PARENTS}" | jq 'length')" -ne 2 ]]; then
  report_error "Last commit must be a merge commit with exactly two parents"
fi

EXPECTED_RELEASE_HEAD=$(git rev-parse "${REMOTE_RELEASE_BRANCH}")
if echo "${LAST_COMMIT_PARENTS}" | jq -e --arg rel "${EXPECTED_RELEASE_HEAD}" 'index($rel) != null' > /dev/null; then
  LINEAR_HEAD=$(echo "${LAST_COMMIT_PARENTS}" | jq -r '[.[] | select(. != $rel)][0]' --arg rel "${EXPECTED_RELEASE_HEAD}")
else
  report_error "Last commit must merge the release branch (${RELEASE_BRANCH})"
fi
echo "✅ Last commit correctly merges the previous commit and the release branch"
echo "Top commit of linear history: ${LINEAR_HEAD}"

MERGE_COMMIT_TREE=$(git rev-parse "${LAST_COMMIT}^{tree}")
LINEAR_HEAD_TREE=$(git rev-parse "${LINEAR_HEAD}^{tree}")

if [[ "${MERGE_COMMIT_TREE}" != "${LINEAR_HEAD_TREE}" ]]; then
  report_error "Tree of merge commit (${MERGE_COMMIT_TREE}) does not match tree of linear history head (${LINEAR_HEAD_TREE})
  This indicates that the merge of ${RELEASE_BRANCH} into this branch was not performed using the merge strategy 'ours'"
fi
echo "✅ Merge commit tree matches the linear history head"

EXPECTED_PREVIOUS_COMMIT="${LINEAR_HEAD}"

# Now traverse down the history, ensuring each commit has exactly one parent
CURRENT_COMMIT="${EXPECTED_PREVIOUS_COMMIT}"
while [[ "${CURRENT_COMMIT}" != "${MERGE_BASE}" && "${CURRENT_COMMIT}" != "${EXPECTED_RELEASE_HEAD}" ]]; do
  CURRENT_COMMIT_PARENTS=$(git cat-file -p "${CURRENT_COMMIT}" | jq -sR '[capture("parent (?<parent>[0-9a-f]{40})"; "g") | .parent]')

  if [[ "$(echo "${CURRENT_COMMIT_PARENTS}" | jq 'length')" -ne 1 ]]; then
    report_error "Commit ${CURRENT_COMMIT} must have exactly one parent"
  fi

  NEXT_COMMIT=$(echo "${CURRENT_COMMIT_PARENTS}" | jq -r '.[0]')

  if [[ "${NEXT_COMMIT}" == "${MERGE_BASE}" ]]; then
    echo "✅ Reached merge base (${MERGE_BASE})"
    PR_BASE="${MERGE_BASE}"
  elif [[ "${NEXT_COMMIT}" == "${EXPECTED_RELEASE_HEAD}" ]]; then
    echo "✅ Reached release branch (${EXPECTED_RELEASE_HEAD})"
    PR_BASE="${EXPECTED_RELEASE_HEAD}"
  elif [[ -z "${NEXT_COMMIT}" ]]; then
    report_error "Unexpected end of commit history before reaching merge base"
  fi

  # Move to the next commit in the chain
  CURRENT_COMMIT="${NEXT_COMMIT}"
done

echo "✅ All commits are properly ordered and linear"
echo "✅ Release PR structure is valid"

echo

message "Commits that are part of this release:
$(git log --oneline "${PR_BASE}..${LINEAR_HEAD}")"


================================================
FILE: .github/scripts/previous-releases.jq
================================================
# Expects response from https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases as input,
# with tag names `release` for storage, `release-compute` for compute and `release-proxy` for proxy releases.
# Extract only the `tag_name` field from each release object
[ .[].tag_name ]

# Transform each tag name into a structured object using regex capture
| reduce map(
    capture("^(?<full>release(-(?<component>proxy|compute))?-(?<version>\\d+))$")
    | {
        component: (.component // "storage"),  # Default to "storage" if no component is specified
        version: (.version | tonumber),        # Convert the version number to an integer
        full: .full                            # Store the full tag name for final output
      }
  )[] as $entry  # Loop over the transformed list

# Accumulate the latest (highest-numbered) version for each component
({};
 .[$entry.component] |= (if . == null or $entry.version > .version then $entry else . end))

# Ensure that each component exists, or fail
| (["storage", "compute", "proxy"] - (keys)) as $missing
| if ($missing | length) > 0 then
    "Error: Found no release for \($missing | join(", "))!\n" | halt_error(1)
  else . end

# Convert the resulting object into an array of formatted strings
| to_entries
| map("\(.key)=\(.value.full)")

# Output each string separately
| .[]


================================================
FILE: .github/scripts/push_with_image_map.py
================================================
import json
import os
import subprocess

RED = "\033[91m"
RESET = "\033[0m"

image_map = os.getenv("IMAGE_MAP")
if not image_map:
    raise ValueError("IMAGE_MAP environment variable is not set")

try:
    parsed_image_map: dict[str, list[str]] = json.loads(image_map)
except json.JSONDecodeError as e:
    raise ValueError("Failed to parse IMAGE_MAP as JSON") from e

failures = []

pending = [(source, target) for source, targets in parsed_image_map.items() for target in targets]

while len(pending) > 0:
    if len(failures) > 10:
        print("Error: more than 10 failures!")
        for failure in failures:
            print(f'"{failure[0]}" failed with the following output:')
            print(failure[1])
        raise RuntimeError("Retry limit reached.")

    source, target = pending.pop(0)
    cmd = ["docker", "buildx", "imagetools", "create", "-t", target, source]
    print(f"Running: {' '.join(cmd)}")
    result = subprocess.run(cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

    if result.returncode != 0:
        failures.append((" ".join(cmd), result.stdout, target))
        pending.append((source, target))
        print(
            f"{RED}[RETRY]{RESET} Push failed for {target}. Retrying... (failure count: {len(failures)})"
        )
        print(result.stdout)

if len(failures) > 0 and (github_output := os.getenv("GITHUB_OUTPUT")):
    failed_targets = [target for _, _, target in failures]
    with open(github_output, "a") as f:
        f.write(f"push_failures={json.dumps(failed_targets)}\n")


================================================
FILE: .github/workflows/_benchmarking_preparation.yml
================================================
name: Prepare benchmarking databases by restoring dumps

on:
  workflow_call:
    # no inputs needed

defaults:
  run:
    shell: bash -euxo pipefail {0}

permissions:
  contents: read

jobs:
  setup-databases:
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    strategy:
      fail-fast: false
      matrix:
        platform: [ aws-rds-postgres, aws-aurora-serverless-v2-postgres, neon, neon_pg17 ]
        database: [ clickbench, tpch, userexample ]

    env:
      LD_LIBRARY_PATH: /tmp/neon/pg_install/v16/lib
      PLATFORM: ${{ matrix.platform }}
      PG_BINARIES: /tmp/neon/pg_install/v16/bin

    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - name: Set up Connection String
      id: set-up-prep-connstr
      run: |
        case "${PLATFORM}" in
          neon)
            CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CONNSTR }}
            ;;
          neon_pg17)
            CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CONNSTR_PG17 }}
            ;;
          aws-rds-postgres)
            CONNSTR=${{ secrets.BENCHMARK_RDS_POSTGRES_CONNSTR }}
            ;;
          aws-aurora-serverless-v2-postgres)
            CONNSTR=${{ secrets.BENCHMARK_RDS_AURORA_CONNSTR }}
            ;;
          *)
            echo >&2 "Unknown PLATFORM=${PLATFORM}"
            exit 1
            ;;
        esac

        echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    # we create a table that has one row for each database that we want to restore with the status whether the restore is done
    - name: Create benchmark_restore_status table if it does not exist
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-prep-connstr.outputs.connstr }}
        DATABASE_NAME: ${{ matrix.database }}
      # to avoid a race condition of multiple jobs trying to create the table at the same time,
      # we use an advisory lock
      run: |
        ${PG_BINARIES}/psql "${{ env.BENCHMARK_CONNSTR }}" -c "
        SELECT pg_advisory_lock(4711);
        CREATE TABLE IF NOT EXISTS benchmark_restore_status (
        databasename text primary key,
        restore_done boolean
        );
        SELECT pg_advisory_unlock(4711);
        "

    - name: Check if restore is already done
      id: check-restore-done
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-prep-connstr.outputs.connstr }}
        DATABASE_NAME: ${{ matrix.database }}
      run: |
        skip=false
        if ${PG_BINARIES}/psql "${{ env.BENCHMARK_CONNSTR }}" -tAc "SELECT 1 FROM benchmark_restore_status WHERE databasename='${{ env.DATABASE_NAME }}' AND restore_done=true;" | grep -q 1; then
          echo "Restore already done for database ${{ env.DATABASE_NAME }} on platform ${{ env.PLATFORM }}. Skipping this database."
          skip=true
        fi
        echo "skip=${skip}" | tee -a $GITHUB_OUTPUT

    - name: Check and create database if it does not exist
      if: steps.check-restore-done.outputs.skip != 'true'
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-prep-connstr.outputs.connstr }}
        DATABASE_NAME: ${{ matrix.database }}
      run: |
        DB_EXISTS=$(${PG_BINARIES}/psql "${{ env.BENCHMARK_CONNSTR }}" -tAc "SELECT 1 FROM pg_database WHERE datname='${{ env.DATABASE_NAME }}'")
        if [ "$DB_EXISTS" != "1" ]; then
          echo "Database ${{ env.DATABASE_NAME }} does not exist. Creating it..."
          ${PG_BINARIES}/psql "${{ env.BENCHMARK_CONNSTR }}" -c "CREATE DATABASE \"${{ env.DATABASE_NAME }}\";"
        else
          echo "Database ${{ env.DATABASE_NAME }} already exists."
        fi

    - name: Download dump from S3 to /tmp/dumps
      if: steps.check-restore-done.outputs.skip != 'true'
      env:
        DATABASE_NAME: ${{ matrix.database }}
      run: |
        mkdir -p /tmp/dumps
        aws s3 cp s3://neon-github-dev/performance/pgdumps/$DATABASE_NAME/$DATABASE_NAME.pg_dump /tmp/dumps/

    - name: Replace database name in connection string
      if: steps.check-restore-done.outputs.skip != 'true'
      id: replace-dbname
      env:
        DATABASE_NAME: ${{ matrix.database }}
        BENCHMARK_CONNSTR: ${{ steps.set-up-prep-connstr.outputs.connstr }}
      run: |
        # Extract the part before the database name
        base_connstr="${BENCHMARK_CONNSTR%/*}"
        # Extract the query parameters (if any) after the database name
        query_params="${BENCHMARK_CONNSTR#*\?}"
        # Reconstruct the new connection string
        if [ "$query_params" != "$BENCHMARK_CONNSTR" ]; then
          new_connstr="${base_connstr}/${DATABASE_NAME}?${query_params}"
        else
          new_connstr="${base_connstr}/${DATABASE_NAME}"
        fi
        echo "database_connstr=${new_connstr}" >> $GITHUB_OUTPUT

    - name: Restore dump
      if: steps.check-restore-done.outputs.skip != 'true'
      env:
        DATABASE_NAME: ${{ matrix.database }}
        DATABASE_CONNSTR: ${{ steps.replace-dbname.outputs.database_connstr }}
        # the following works only with larger computes:
        # PGOPTIONS: "-c maintenance_work_mem=8388608 -c max_parallel_maintenance_workers=7"
        # we add the || true because:
        # the dumps were created with Neon and contain neon extensions that are not
        # available in RDS, so we will always report an error, but we can ignore it
      run: |
        ${PG_BINARIES}/pg_restore --clean --if-exists --no-owner --jobs=4 \
        -d "${DATABASE_CONNSTR}" /tmp/dumps/${DATABASE_NAME}.pg_dump || true

    - name: Update benchmark_restore_status table
      if: steps.check-restore-done.outputs.skip != 'true'
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-prep-connstr.outputs.connstr }}
        DATABASE_NAME: ${{ matrix.database }}
      run: |
        ${PG_BINARIES}/psql "${{ env.BENCHMARK_CONNSTR }}" -c "
        INSERT INTO benchmark_restore_status (databasename, restore_done) VALUES ('${{ env.DATABASE_NAME }}', true)
        ON CONFLICT (databasename) DO UPDATE SET restore_done = true;
        "


================================================
FILE: .github/workflows/_build-and-test-locally.yml
================================================
name: Build and Test Locally

on:
  workflow_call:
    inputs:
      arch:
        description: 'x64 or arm64'
        required: true
        type: string
      build-tag:
        description: 'build tag'
        required: true
        type: string
      build-tools-image:
        description: 'build-tools image'
        required: true
        type: string
      build-type:
        description: 'debug or release'
        required: true
        type: string
      test-cfg:
        description: 'a json object of postgres versions and lfc states to run regression tests on'
        required: true
        type: string
      sanitizers:
        description: 'enabled or disabled'
        required: false
        default: 'disabled'
        type: string
      test-selection:
        description: 'specification of selected test(s) to run'
        required: false
        default: ''
        type: string
      test-run-count:
        description: 'number of runs to perform for selected tests'
        required: false
        default: 1
        type: number
      rerun-failed:
        description: 'rerun failed tests to ignore flaky tests'
        required: false
        default: true
        type: boolean

defaults:
  run:
    shell: bash -euxo pipefail {0}

env:
  RUST_BACKTRACE: 1
  COPT: '-Werror'

permissions:
  contents: read

jobs:
  build-neon:
    runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large')) }}
    permissions:
      id-token: write # aws-actions/configure-aws-credentials
      contents: read
    container:
      image: ${{ inputs.build-tools-image }}
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      # Raise locked memory limit for tokio-epoll-uring.
      # On 5.10 LTS kernels < 5.10.162 (and generally mainline kernels < 5.12),
      # io_uring will account the memory of the CQ and SQ as locked.
      # More details: https://github.com/neondatabase/neon/issues/6373#issuecomment-1905814391
      options: --init --shm-size=512mb --ulimit memlock=67108864:67108864
    env:
      BUILD_TYPE: ${{ inputs.build-type }}
      GIT_VERSION: ${{ github.event.pull_request.head.sha || github.sha }}
      BUILD_TAG: ${{ inputs.build-tag }}

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          submodules: true

      - uses: ./.github/actions/prepare-for-subzero
        with:
          token: ${{ secrets.CI_ACCESS_TOKEN }}

      - name: Set pg 14 revision for caching
        id: pg_v14_rev
        run: echo pg_rev=$(git rev-parse HEAD:vendor/postgres-v14) >> $GITHUB_OUTPUT

      - name: Set pg 15 revision for caching
        id: pg_v15_rev
        run: echo pg_rev=$(git rev-parse HEAD:vendor/postgres-v15) >> $GITHUB_OUTPUT

      - name: Set pg 16 revision for caching
        id: pg_v16_rev
        run: echo pg_rev=$(git rev-parse HEAD:vendor/postgres-v16) >> $GITHUB_OUTPUT

      - name: Set pg 17 revision for caching
        id: pg_v17_rev
        run: echo pg_rev=$(git rev-parse HEAD:vendor/postgres-v17) >> $GITHUB_OUTPUT

      # Set some environment variables used by all the steps.
      #
      # CARGO_FLAGS is extra options to pass to all "cargo" subcommands.
      #
      # CARGO_PROFILE is passed to "cargo build", "cargo test" etc, but not to
      #   "cargo metadata", because it doesn't accept --release or --debug options.
      #
      # We run tests with addtional features, that are turned off by default (e.g. in release builds), see
      # corresponding Cargo.toml files for their descriptions.
      - name: Set env variables
        env:
          ARCH: ${{ inputs.arch }}
          SANITIZERS: ${{ inputs.sanitizers }}
        run: |
          CARGO_FLAGS="--locked --features testing,rest_broker"
          if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' ]]; then
            cov_prefix="scripts/coverage --profraw-prefix=$GITHUB_JOB --dir=/tmp/coverage run"
            CARGO_PROFILE=""
          elif [[ $BUILD_TYPE == "debug" ]]; then
            cov_prefix=""
            CARGO_PROFILE=""
          elif [[ $BUILD_TYPE == "release" ]]; then
            cov_prefix=""
            CARGO_PROFILE="--release"
          fi
          if [[ $SANITIZERS == 'enabled' ]]; then
            make_vars="WITH_SANITIZERS=yes"
          else
            make_vars=""
          fi
          {
            echo "cov_prefix=${cov_prefix}"
            echo "make_vars=${make_vars}"
            echo "CARGO_FLAGS=${CARGO_FLAGS}"
            echo "CARGO_PROFILE=${CARGO_PROFILE}"
            echo "CARGO_HOME=${GITHUB_WORKSPACE}/.cargo"
          } >> $GITHUB_ENV

      - name: Cache postgres v14 build
        id: cache_pg_14
        uses: tespkg/actions-cache@b7bf5fcc2f98a52ac6080eb0fd282c2f752074b1  # v1.8.0
        with:
          endpoint: ${{ vars.HETZNER_CACHE_REGION }}.${{ vars.HETZNER_CACHE_ENDPOINT }}
          bucket: ${{ vars.HETZNER_CACHE_BUCKET }}
          accessKey: ${{ secrets.HETZNER_CACHE_ACCESS_KEY }}
          secretKey: ${{ secrets.HETZNER_CACHE_SECRET_KEY }}
          use-fallback: false
          path: pg_install/v14
          key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v14_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'build-tools/Dockerfile') }}

      - name: Cache postgres v15 build
        id: cache_pg_15
        uses: tespkg/actions-cache@b7bf5fcc2f98a52ac6080eb0fd282c2f752074b1  # v1.8.0
        with:
          endpoint: ${{ vars.HETZNER_CACHE_REGION }}.${{ vars.HETZNER_CACHE_ENDPOINT }}
          bucket: ${{ vars.HETZNER_CACHE_BUCKET }}
          accessKey: ${{ secrets.HETZNER_CACHE_ACCESS_KEY }}
          secretKey: ${{ secrets.HETZNER_CACHE_SECRET_KEY }}
          use-fallback: false
          path: pg_install/v15
          key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v15_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'build-tools/Dockerfile') }}

      - name: Cache postgres v16 build
        id: cache_pg_16
        uses: tespkg/actions-cache@b7bf5fcc2f98a52ac6080eb0fd282c2f752074b1  # v1.8.0
        with:
          endpoint: ${{ vars.HETZNER_CACHE_REGION }}.${{ vars.HETZNER_CACHE_ENDPOINT }}
          bucket: ${{ vars.HETZNER_CACHE_BUCKET }}
          accessKey: ${{ secrets.HETZNER_CACHE_ACCESS_KEY }}
          secretKey: ${{ secrets.HETZNER_CACHE_SECRET_KEY }}
          use-fallback: false
          path: pg_install/v16
          key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v16_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'build-tools/Dockerfile') }}

      - name: Cache postgres v17 build
        id: cache_pg_17
        uses: tespkg/actions-cache@b7bf5fcc2f98a52ac6080eb0fd282c2f752074b1  # v1.8.0
        with:
          endpoint: ${{ vars.HETZNER_CACHE_REGION }}.${{ vars.HETZNER_CACHE_ENDPOINT }}
          bucket: ${{ vars.HETZNER_CACHE_BUCKET }}
          accessKey: ${{ secrets.HETZNER_CACHE_ACCESS_KEY }}
          secretKey: ${{ secrets.HETZNER_CACHE_SECRET_KEY }}
          use-fallback: false
          path: pg_install/v17
          key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v17_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'build-tools/Dockerfile') }}

      - name: Build all
        # Note: the Makefile picks up BUILD_TYPE and CARGO_PROFILE from the env variables
        run: mold -run make ${make_vars} all -j$(nproc) CARGO_BUILD_FLAGS="$CARGO_FLAGS"

      - name: Build walproposer-lib
        run: mold -run make ${make_vars} walproposer-lib -j$(nproc)

      - name: Build unit tests
        if: inputs.sanitizers != 'enabled'
        run: |
          export ASAN_OPTIONS=detect_leaks=0
          ${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_PROFILE --tests

      # Do install *before* running rust tests because they might recompile the
      # binaries with different features/flags.
      - name: Install rust binaries
        env:
          ARCH: ${{ inputs.arch }}
          SANITIZERS: ${{ inputs.sanitizers }}
        run: |
          # Install target binaries
          mkdir -p /tmp/neon/bin/
          binaries=$(
            ${cov_prefix} cargo metadata $CARGO_FLAGS --format-version=1 --no-deps |
            jq -r '.packages[].targets[] | select(.kind | index("bin")) | .name'
          )
          for bin in $binaries; do
            SRC=target/$BUILD_TYPE/$bin
            DST=/tmp/neon/bin/$bin
            cp "$SRC" "$DST"
          done

          # Install test executables and write list of all binaries (for code coverage)
          if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' && $SANITIZERS != 'enabled' ]]; then
            # Keep bloated coverage data files away from the rest of the artifact
            mkdir -p /tmp/coverage/

            mkdir -p /tmp/neon/test_bin/

            test_exe_paths=$(
              ${cov_prefix} cargo test $CARGO_FLAGS $CARGO_PROFILE --message-format=json --no-run |
              jq -r '.executable | select(. != null)'
            )
            for bin in $test_exe_paths; do
              SRC=$bin
              DST=/tmp/neon/test_bin/$(basename $bin)

              # We don't need debug symbols for code coverage, so strip them out to make
              # the artifact smaller.
              strip "$SRC" -o "$DST"
              echo "$DST" >> /tmp/coverage/binaries.list
            done

            for bin in $binaries; do
              echo "/tmp/neon/bin/$bin" >> /tmp/coverage/binaries.list
            done
          fi

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
        with:
          aws-region: eu-central-1
          role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
          role-duration-seconds: 18000 # 5 hours

      - name: Run rust tests
        if: ${{ inputs.sanitizers != 'enabled' }}
        env:
          NEXTEST_RETRIES: 3
        run: |
          LD_LIBRARY_PATH=$(pwd)/pg_install/v17/lib
          export LD_LIBRARY_PATH

          #nextest does not yet support running doctests
          ${cov_prefix} cargo test --doc $CARGO_FLAGS $CARGO_PROFILE

          # run all non-pageserver tests
          ${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_PROFILE -E '!package(pageserver)'

          # run pageserver tests
          # (When developing new pageserver features gated by config fields, we commonly make the rust
          # unit tests sensitive to an environment variable NEON_PAGESERVER_UNIT_TEST_FEATURENAME.
          # Then run the nextest invocation below for all relevant combinations. Singling out the
          # pageserver tests from non-pageserver tests cuts down the time it takes for this CI step.)
          NEON_PAGESERVER_UNIT_TEST_VIRTUAL_FILE_IOENGINE=tokio-epoll-uring  \
          ${cov_prefix} \
          cargo nextest run $CARGO_FLAGS $CARGO_PROFILE  -E 'package(pageserver)'

          # Run separate tests for real S3
          export ENABLE_REAL_S3_REMOTE_STORAGE=nonempty
          export REMOTE_STORAGE_S3_BUCKET=neon-github-ci-tests
          export REMOTE_STORAGE_S3_REGION=eu-central-1
          ${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_PROFILE -E 'package(remote_storage)' -E 'test(test_real_s3)'

          # Run separate tests for real Azure Blob Storage
          # XXX: replace region with `eu-central-1`-like region
          export ENABLE_REAL_AZURE_REMOTE_STORAGE=y
          export AZURE_STORAGE_ACCOUNT="${{ secrets.AZURE_STORAGE_ACCOUNT_DEV }}"
          export AZURE_STORAGE_ACCESS_KEY="${{ secrets.AZURE_STORAGE_ACCESS_KEY_DEV }}"
          export REMOTE_STORAGE_AZURE_CONTAINER="${{ vars.REMOTE_STORAGE_AZURE_CONTAINER }}"
          export REMOTE_STORAGE_AZURE_REGION="${{ vars.REMOTE_STORAGE_AZURE_REGION }}"
          ${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_PROFILE -E 'package(remote_storage)' -E 'test(test_real_azure)'

      - name: Install postgres binaries
        run: |
          # Use tar to copy files matching the pattern, preserving the paths in the destionation
          tar c \
            pg_install/v* \
            build/*/src/test/regress/*.so \
            build/*/src/test/regress/pg_regress \
            build/*/src/test/isolation/isolationtester \
            build/*/src/test/isolation/pg_isolation_regress \
            | tar  x -C /tmp/neon

      - name: Upload Neon artifact
        uses: ./.github/actions/upload
        with:
          name: neon-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}${{ inputs.sanitizers == 'enabled' && '-sanitized' || '' }}-artifact
          path: /tmp/neon
          aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

      - name: Check diesel schema
        if: inputs.build-type == 'release' && inputs.arch == 'x64'
        env:
          DATABASE_URL: postgresql://localhost:1235/storage_controller
          POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
        run: |
          export ASAN_OPTIONS=detect_leaks=0
          /tmp/neon/bin/neon_local init
          /tmp/neon/bin/neon_local storage_controller start

          diesel print-schema > storage_controller/src/schema.rs

          if [ -n "$(git diff storage_controller/src/schema.rs)" ]; then
            echo >&2 "Uncommitted changes in diesel schema"

            git diff .
            exit 1
          fi

          /tmp/neon/bin/neon_local storage_controller stop

      # XXX: keep this after the binaries.list is formed, so the coverage can properly work later
      - name: Merge and upload coverage data
        if: inputs.build-type == 'debug'
        uses: ./.github/actions/save-coverage-data

  regress-tests:
    # Don't run regression tests on debug arm64 builds
    if: inputs.build-type != 'debug' || inputs.arch != 'arm64'
    permissions:
      id-token: write # aws-actions/configure-aws-credentials
      contents: read
      statuses: write
    needs: [ build-neon ]
    runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large-metal')) }}
    container:
      image: ${{ inputs.build-tools-image }}
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      # for changed limits, see comments on `options:` earlier in this file
      options: --init --shm-size=512mb --ulimit memlock=67108864:67108864
    strategy:
      fail-fast: false
      matrix: ${{ fromJSON(format('{{"include":{0}}}', inputs.test-cfg)) }}
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          submodules: true

      - name: Pytest regression tests
        continue-on-error: ${{ matrix.lfc_state == 'with-lfc' && inputs.build-type == 'debug' }}
        uses: ./.github/actions/run-python-test-set
        timeout-minutes: ${{ (inputs.build-type == 'release' && inputs.sanitizers != 'enabled') && 75 || 180 }}
        with:
          build_type: ${{ inputs.build-type }}
          test_selection: regress
          needs_postgres_source: true
          run_with_real_s3: true
          real_s3_bucket: neon-github-ci-tests
          real_s3_region: eu-central-1
          rerun_failed: ${{ inputs.rerun-failed }}
          pg_version: ${{ matrix.pg_version }}
          sanitizers: ${{ inputs.sanitizers }}
          aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
          # `--session-timeout` is equal to (timeout-minutes - 10 minutes) * 60 seconds.
          # Attempt to stop tests gracefully to generate test reports
          # until they are forcibly stopped by the stricter `timeout-minutes` limit.
          extra_params: --session-timeout=${{ (inputs.build-type == 'release' && inputs.sanitizers != 'enabled') && 3000 || 10200 }} --count=${{ inputs.test-run-count }}
                        ${{ inputs.test-selection != '' && format('-k "{0}"', inputs.test-selection) || '' }}
        env:
          TEST_RESULT_CONNSTR: ${{ secrets.REGRESS_TEST_RESULT_CONNSTR_NEW }}
          CHECK_ONDISK_DATA_COMPATIBILITY: nonempty
          BUILD_TAG: ${{ inputs.build-tag }}
          PAGESERVER_VIRTUAL_FILE_IO_ENGINE: tokio-epoll-uring
          USE_LFC: ${{ matrix.lfc_state == 'with-lfc' && 'true' || 'false' }}

      # Temporary disable this step until we figure out why it's so flaky
      # Ref https://github.com/neondatabase/neon/issues/4540
      - name: Merge and upload coverage data
        if: |
          false &&
          inputs.build-type == 'debug' && matrix.pg_version == 'v16'
        uses: ./.github/actions/save-coverage-data


================================================
FILE: .github/workflows/_check-codestyle-python.yml
================================================
name: Check Codestyle Python

on:
  workflow_call:
    inputs:
      build-tools-image:
        description: 'build-tools image'
        required: true
        type: string

defaults:
  run:
    shell: bash -euxo pipefail {0}

permissions:
  contents: read

jobs:
  check-codestyle-python:
    runs-on: [ self-hosted, small ]

    permissions:
      packages: read

    container:
      image: ${{ inputs.build-tools-image }}
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Cache poetry deps
        uses: tespkg/actions-cache@b7bf5fcc2f98a52ac6080eb0fd282c2f752074b1  # v1.8.0
        with:
          endpoint: ${{ vars.HETZNER_CACHE_REGION }}.${{ vars.HETZNER_CACHE_ENDPOINT }}
          bucket: ${{ vars.HETZNER_CACHE_BUCKET }}
          accessKey: ${{ secrets.HETZNER_CACHE_ACCESS_KEY }}
          secretKey: ${{ secrets.HETZNER_CACHE_SECRET_KEY }}
          use-fallback: false
          path: ~/.cache/pypoetry/virtualenvs
          key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}

      - run: ./scripts/pysync

      - run: poetry run ruff check .
      - run: poetry run ruff format --check .
      - run: poetry run mypy .


================================================
FILE: .github/workflows/_check-codestyle-rust.yml
================================================
name: Check Codestyle Rust

on:
  workflow_call:
    inputs:
      build-tools-image:
        description: "build-tools image"
        required: true
        type: string
      archs:
        description: "Json array of architectures to run on"
        type: string


defaults:
  run:
    shell: bash -euxo pipefail {0}

# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
permissions: {}

jobs:
  check-codestyle-rust:
    strategy:
      matrix:
        arch: ${{ fromJSON(inputs.archs) }}
    runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}

    permissions:
      packages: read

    container:
      image: ${{ inputs.build-tools-image }}
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - name: Checkout
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          submodules: true
      
      - uses: ./.github/actions/prepare-for-subzero
        with:
          token: ${{ secrets.CI_ACCESS_TOKEN }}

      - name: Cache cargo deps
        uses: tespkg/actions-cache@b7bf5fcc2f98a52ac6080eb0fd282c2f752074b1  # v1.8.0
        with:
          endpoint: ${{ vars.HETZNER_CACHE_REGION }}.${{ vars.HETZNER_CACHE_ENDPOINT }}
          bucket: ${{ vars.HETZNER_CACHE_BUCKET }}
          accessKey: ${{ secrets.HETZNER_CACHE_ACCESS_KEY }}
          secretKey: ${{ secrets.HETZNER_CACHE_SECRET_KEY }}
          use-fallback: false
          path: |
            ~/.cargo/registry
            !~/.cargo/registry/src
            ~/.cargo/git
            target
          key: v1-${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('./Cargo.lock') }}-${{ hashFiles('./rust-toolchain.toml') }}-rust

      # Some of our rust modules use FFI and need those to be checked
      - name: Get postgres headers
        run: make postgres-headers -j$(nproc)

      # cargo hack runs the given cargo subcommand (clippy in this case) for all feature combinations.
      # This will catch compiler & clippy warnings in all feature combinations.
      # TODO: use cargo hack for build and test as well, but, that's quite expensive.
      # NB: keep clippy args in sync with ./run_clippy.sh
      #
      # The only difference between "clippy --debug" and "clippy --release" is that in --release mode,
      # #[cfg(debug_assertions)] blocks are not built. It's not worth building everything for second
      # time just for that, so skip "clippy --release".
      - run: |
          CLIPPY_COMMON_ARGS="$( source .neon_clippy_args; echo "$CLIPPY_COMMON_ARGS")"
          if [ "$CLIPPY_COMMON_ARGS" = "" ]; then
            echo "No clippy args found in .neon_clippy_args"
            exit 1
          fi
          echo "CLIPPY_COMMON_ARGS=${CLIPPY_COMMON_ARGS}" >> $GITHUB_ENV
      - name: Run cargo clippy (debug)
        run: cargo hack --features default --ignore-unknown-features --feature-powerset clippy $CLIPPY_COMMON_ARGS

      - name: Check documentation generation
        run: cargo doc --workspace --no-deps --document-private-items
        env:
          RUSTDOCFLAGS: "-Dwarnings -Arustdoc::private_intra_doc_links"

      # Use `${{ !cancelled() }}` to run quck tests after the longer clippy run
      - name: Check formatting
        if: ${{ !cancelled() }}
        run: cargo fmt --all -- --check

      # https://github.com/facebookincubator/cargo-guppy/tree/bec4e0eb29dcd1faac70b1b5360267fc02bf830e/tools/cargo-hakari#2-keep-the-workspace-hack-up-to-date-in-ci
      - name: Check rust dependencies
        if: ${{ !cancelled() }}
        run: |
          cargo hakari generate --diff  # workspace-hack Cargo.toml is up-to-date
          cargo hakari manage-deps --dry-run  # all workspace crates depend on workspace-hack


================================================
FILE: .github/workflows/_meta.yml
================================================
name: Generate run metadata
on:
  workflow_call:
    inputs:
      github-event-name:
        type: string
        required: true
      github-event-json:
        type: string
        required: true
    outputs:
      build-tag:
        description: "Tag for the current workflow run"
        value: ${{ jobs.tags.outputs.build-tag }}
      release-tag:
        description: "Tag for the release if this is an RC PR run"
        value: ${{ jobs.tags.outputs.release-tag }}
      previous-storage-release:
        description: "Tag of the last storage release"
        value: ${{ jobs.tags.outputs.storage }}
      previous-proxy-release:
        description: "Tag of the last proxy release"
        value: ${{ jobs.tags.outputs.proxy }}
      previous-compute-release:
        description: "Tag of the last compute release"
        value: ${{ jobs.tags.outputs.compute }}
      run-kind:
        description: "The kind of run we're currently in. Will be one of `push-main`, `storage-release`, `compute-release`, `proxy-release`, `storage-rc-pr`, `compute-rc-pr`,  `proxy-rc-pr`, `pr`, or `workflow-dispatch`"
        value: ${{ jobs.tags.outputs.run-kind }}
      release-pr-run-id:
        description: "Only available if `run-kind in [storage-release, proxy-release, compute-release]`. Contains the run ID of the `Build and Test` workflow, assuming one with the current commit can be found."
        value: ${{ jobs.tags.outputs.release-pr-run-id }}
      sha:
        description: "github.event.pull_request.head.sha on release PRs, github.sha otherwise"
        value: ${{ jobs.tags.outputs.sha }}

permissions: {}

defaults:
  run:
    shell: bash -euo pipefail {0}

jobs:
  tags:
    runs-on: ubuntu-22.04
    outputs:
      build-tag: ${{ steps.build-tag.outputs.build-tag }}
      release-tag: ${{ steps.build-tag.outputs.release-tag }}
      compute: ${{ steps.previous-releases.outputs.compute }}
      proxy: ${{ steps.previous-releases.outputs.proxy }}
      storage: ${{ steps.previous-releases.outputs.storage }}
      run-kind: ${{ steps.run-kind.outputs.run-kind }}
      release-pr-run-id: ${{ steps.release-pr-run-id.outputs.release-pr-run-id }}
      sha: ${{ steps.sha.outputs.sha }}
    permissions:
      contents: read
    steps:
      # Need `fetch-depth: 0` to count the number of commits in the branch
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - name: Get run kind
        id: run-kind
        env:
          RUN_KIND: >-
            ${{
              false
              || (inputs.github-event-name == 'push'         && github.ref_name == 'main')            && 'push-main'
              || (inputs.github-event-name == 'push'         && github.ref_name == 'release')         && 'storage-release'
              || (inputs.github-event-name == 'push'         && github.ref_name == 'release-compute') && 'compute-release'
              || (inputs.github-event-name == 'push'         && github.ref_name == 'release-proxy')   && 'proxy-release'
              || (inputs.github-event-name == 'pull_request' && github.base_ref == 'release')         && 'storage-rc-pr'
              || (inputs.github-event-name == 'pull_request' && github.base_ref == 'release-compute') && 'compute-rc-pr'
              || (inputs.github-event-name == 'pull_request' && github.base_ref == 'release-proxy')   && 'proxy-rc-pr'
              || (inputs.github-event-name == 'pull_request')                                         && 'pr'
              || (inputs.github-event-name == 'workflow_dispatch')                                    && 'workflow-dispatch'
              || 'unknown'
            }}
        run: |
          echo "run-kind=$RUN_KIND" | tee -a $GITHUB_OUTPUT

      - name: Get the right SHA
        id: sha
        env:
          SHA: >
            ${{
              contains(fromJSON('["storage-rc-pr", "proxy-rc-pr", "compute-rc-pr"]'), steps.run-kind.outputs.run-kind)
              && fromJSON(inputs.github-event-json).pull_request.head.sha
              || github.sha
            }}
        run: |
          echo "sha=$SHA" | tee -a $GITHUB_OUTPUT

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          fetch-depth: 0
          ref: ${{ steps.sha.outputs.sha }}

      - name: Get build tag
        id: build-tag
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }}
          CURRENT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
          RUN_KIND: ${{ steps.run-kind.outputs.run-kind }}
        run: |
          case $RUN_KIND in
          push-main)
            echo "build-tag=$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT
            ;;
          storage-release)
            echo "build-tag=release-$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT
            ;;
          proxy-release)
            echo "build-tag=release-proxy-$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT
            ;;
          compute-release)
            echo "build-tag=release-compute-$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT
            ;;
          pr|storage-rc-pr|compute-rc-pr|proxy-rc-pr)
            BUILD_AND_TEST_RUN_ID=$(gh api --paginate \
              -H "Accept: application/vnd.github+json" \
              -H "X-GitHub-Api-Version: 2022-11-28" \
              "/repos/${GITHUB_REPOSITORY}/actions/runs?head_sha=${CURRENT_SHA}&branch=${CURRENT_BRANCH}" \
              | jq '[.workflow_runs[] | select(.name == "Build and Test")][0].id // ("Error: No matching workflow run found." | halt_error(1))')
            echo "build-tag=$BUILD_AND_TEST_RUN_ID" | tee -a $GITHUB_OUTPUT
            case $RUN_KIND in
            storage-rc-pr)
              echo "release-tag=release-$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT
              ;;
            proxy-rc-pr)
              echo "release-tag=release-proxy-$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT
              ;;
            compute-rc-pr)
              echo "release-tag=release-compute-$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT
              ;;
            esac
            ;;
          workflow-dispatch)
            echo "build-tag=$GITHUB_RUN_ID" | tee -a $GITHUB_OUTPUT
            ;;
          *)
            echo "Unexpected RUN_KIND ('${RUN_KIND}'), failing to assign build-tag!"
            exit 1
          esac

      - name: Get the previous release-tags
        id: previous-releases
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh api --paginate \
            -H "Accept: application/vnd.github+json" \
            -H "X-GitHub-Api-Version: 2022-11-28" \
            "/repos/${GITHUB_REPOSITORY}/releases" \
          | jq -f .github/scripts/previous-releases.jq -r \
          | tee -a "${GITHUB_OUTPUT}"

      - name: Get the release PR run ID
        id: release-pr-run-id
        if: ${{ contains(fromJSON('["storage-release", "compute-release", "proxy-release"]'), steps.run-kind.outputs.run-kind) }}
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CURRENT_SHA: ${{ github.sha }}
        run: |
          RELEASE_PR_RUN_ID=$(gh api "/repos/${GITHUB_REPOSITORY}/actions/runs?head_sha=$CURRENT_SHA" | jq '[.workflow_runs[] | select(.name == "Build and Test") | select(.head_branch | test("^rc/release.*$"; "s"))] | first | .id // ("Failed to find Build and Test run from  RC PR!" | halt_error(1))')
          echo "release-pr-run-id=$RELEASE_PR_RUN_ID" | tee -a $GITHUB_OUTPUT


================================================
FILE: .github/workflows/_push-to-container-registry.yml
================================================
name: Push images to Container Registry
on:
  workflow_call:
    inputs:
      # Example: {"docker.io/neondatabase/neon:13196061314":["${{ vars.NEON_DEV_AWS_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_ECR_REGION }}.amazonaws.com/neon:13196061314","neoneastus2.azurecr.io/neondatabase/neon:13196061314"]}
      image-map:
        description: JSON map of images, mapping from a source image to an array of target images that should be pushed.
        required: true
        type: string
      aws-region:
        description: AWS region to log in to. Required when pushing to ECR.
        required: false
        type: string
      aws-account-id:
        description: AWS account ID to log in to for pushing to ECR. Required when pushing to ECR.
        required: false
        type: string
      aws-role-to-assume:
        description: AWS role to assume to for pushing to ECR. Required when pushing to ECR.
        required: false
        type: string
      azure-client-id:
        description: Client ID of Azure managed identity or Entra app. Required when pushing to ACR.
        required: false
        type: string
      azure-subscription-id:
        description: Azure subscription ID. Required when pushing to ACR.
        required: false
        type: string
      azure-tenant-id:
        description: Azure tenant ID. Required when pushing to ACR.
        required: false
        type: string
      acr-registry-name:
        description: ACR registry name. Required when pushing to ACR.
        required: false
        type: string

permissions: {}

defaults:
  run:
    shell: bash -euo pipefail {0}

jobs:
  push-to-container-registry:
    runs-on: ubuntu-22.04
    permissions:
      id-token: write  # Required for aws/azure login
      packages: write  # required for pushing to GHCR
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          sparse-checkout: .github/scripts/push_with_image_map.py
          sparse-checkout-cone-mode: false

      - name: Print image-map
        run: echo '${{ inputs.image-map }}' | jq

      - name: Configure AWS credentials
        if: contains(inputs.image-map, 'amazonaws.com/')
        uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
        with:
          aws-region: "${{ inputs.aws-region }}"
          role-to-assume: "arn:aws:iam::${{ inputs.aws-account-id }}:role/${{ inputs.aws-role-to-assume }}"
          role-duration-seconds: 3600

      - name: Login to ECR
        if: contains(inputs.image-map, 'amazonaws.com/')
        uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
        with:
          registries: "${{ inputs.aws-account-id }}"

      - name: Configure Azure credentials
        if: contains(inputs.image-map, 'azurecr.io/')
        uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a  # @v2.1.1
        with:
          client-id: ${{ inputs.azure-client-id }}
          subscription-id: ${{ inputs.azure-subscription-id }}
          tenant-id: ${{ inputs.azure-tenant-id }}

      - name: Login to ACR
        if: contains(inputs.image-map, 'azurecr.io/')
        run: |
          az acr login --name=${{ inputs.acr-registry-name }}

      - name: Login to GHCR
        if: contains(inputs.image-map, 'ghcr.io/')
        uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Log in to Docker Hub
        uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
          password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}

      - name: Copy docker images to target registries
        id: push
        run: python3 .github/scripts/push_with_image_map.py
        env:
          IMAGE_MAP: ${{ inputs.image-map }}

      - name: Notify Slack if container image pushing fails
        if: steps.push.outputs.push_failures || failure()
        uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
        with:
          method: chat.postMessage
          token: ${{ secrets.SLACK_BOT_TOKEN }}
          payload: |
            channel: ${{ vars.SLACK_ON_CALL_DEVPROD_STREAM }}
            text: >
              *Container image pushing ${{
                steps.push.outcome == 'failure' && 'failed completely' || 'succeeded with some retries'
              }}* in
              <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>

              ${{ steps.push.outputs.push_failures && format(
                '*Failed targets:*\n• {0}', join(fromJson(steps.push.outputs.push_failures), '\n• ')
              ) || '' }}


================================================
FILE: .github/workflows/actionlint.yml
================================================
name: Lint GitHub Workflows

on:
  push:
    branches:
      - main
      - release
    paths:
      - '.github/workflows/*.ya?ml'
  pull_request:
    paths:
      - '.github/workflows/*.ya?ml'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  check-permissions:
    if: ${{ !contains(github.event.pull_request.labels.*.name, 'run-no-ci') }}
    uses: ./.github/workflows/check-permissions.yml
    with:
      github-event-name: ${{ github.event_name}}

  actionlint:
    needs: [ check-permissions ]
    runs-on: ubuntu-22.04
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2
        env:
          # SC2046 - Quote this to prevent word splitting. - https://www.shellcheck.net/wiki/SC2046
          # SC2086 - Double quote to prevent globbing and word splitting. - https://www.shellcheck.net/wiki/SC2086
          SHELLCHECK_OPTS: --exclude=SC2046,SC2086
        with:
          fail_level: error
          filter_mode: nofilter
          level: error

      - name: Disallow 'ubuntu-latest' runners
        run: |
          PAT='^\s*runs-on:.*-latest'
          if grep -ERq $PAT .github/workflows; then
            grep -ERl $PAT .github/workflows |\
            while read -r f
            do
              l=$(grep -nE $PAT $f | awk -F: '{print $1}' | head -1)
              echo "::error file=$f,line=$l::Please use 'ubuntu-22.04' instead of 'ubuntu-latest'"
            done
            exit 1
          fi


================================================
FILE: .github/workflows/approved-for-ci-run.yml
================================================
name: Handle `approved-for-ci-run` label
# This workflow helps to run CI pipeline for PRs made by external contributors (from forks).

on:
  pull_request_target:
    branches:
      - main
    types:
      # Default types that triggers a workflow ([1]):
      # - [1] https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
      - opened
      - synchronize
      - reopened
      # Types that we wand to handle in addition to keep labels tidy:
      - closed
      # Actual magic happens here:
      - labeled

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
  cancel-in-progress: false

env:
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  PR_NUMBER: ${{ github.event.pull_request.number }}
  BRANCH: "ci-run/pr-${{ github.event.pull_request.number }}"

# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
permissions: {}

defaults:
  run:
    shell: bash -euo pipefail {0}

jobs:
  remove-label:
    # Remove `approved-for-ci-run` label if the workflow is triggered by changes in a PR.
    # The PR should be reviewed and labelled manually again.

    permissions:
      pull-requests: write # For `gh pr edit`

    if: |
      contains(fromJSON('["opened", "synchronize", "reopened", "closed"]'), github.event.action) &&
      contains(github.event.pull_request.labels.*.name, 'approved-for-ci-run')

    runs-on: ubuntu-22.04

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - run: gh pr --repo "${GITHUB_REPOSITORY}" edit "${PR_NUMBER}" --remove-label "approved-for-ci-run"

  create-or-update-pr-for-ci-run:
    # Create local PR for an `approved-for-ci-run` labelled PR to run CI pipeline in it.

    permissions:
      pull-requests: write # for `gh pr edit`
      # For `git push` and `gh pr create` we use CI_ACCESS_TOKEN

    if: |
      github.event.action == 'labeled' &&
      contains(github.event.pull_request.labels.*.name, 'approved-for-ci-run')

    runs-on: ubuntu-22.04

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - run: gh pr --repo "${GITHUB_REPOSITORY}" edit "${PR_NUMBER}" --remove-label "approved-for-ci-run"

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          token: ${{ secrets.CI_ACCESS_TOKEN }}

      - name: Look for existing PR
        id: get-pr
        env:
          GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
        run: |
          ALREADY_CREATED="$(gh pr --repo ${GITHUB_REPOSITORY} list --head ${BRANCH} --base main --json number --jq '.[].number')"
          echo "ALREADY_CREATED=${ALREADY_CREATED}" >> ${GITHUB_OUTPUT}

      - name: Get changed labels
        id: get-labels
        if: steps.get-pr.outputs.ALREADY_CREATED != ''
        env:
          ALREADY_CREATED: ${{ steps.get-pr.outputs.ALREADY_CREATED }}
          GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
        run: |
          LABELS_TO_REMOVE=$(comm -23 <(gh pr --repo ${GITHUB_REPOSITORY} view ${ALREADY_CREATED} --json labels --jq '.labels.[].name'| ( grep -E '^run' || true ) | sort) \
          <(gh pr --repo ${GITHUB_REPOSITORY} view ${PR_NUMBER} --json labels --jq '.labels.[].name' | ( grep -E '^run' || true ) | sort ) |\
          ( grep -v run-e2e-tests-in-draft || true ) | paste -sd , -)
          LABELS_TO_ADD=$(comm -13 <(gh pr --repo ${GITHUB_REPOSITORY} view ${ALREADY_CREATED} --json labels --jq '.labels.[].name'| ( grep -E '^run' || true ) |sort) \
          <(gh pr --repo ${GITHUB_REPOSITORY} view ${PR_NUMBER} --json labels --jq '.labels.[].name' |  ( grep -E '^run' || true ) | sort ) |\
          paste -sd , -)
          echo "LABELS_TO_ADD=${LABELS_TO_ADD}" >> ${GITHUB_OUTPUT}
          echo "LABELS_TO_REMOVE=${LABELS_TO_REMOVE}" >> ${GITHUB_OUTPUT}

      - run: git checkout -b "${BRANCH}"

      - run: git push --force origin "${BRANCH}"
        if: steps.get-pr.outputs.ALREADY_CREATED == ''

      - name: Create a Pull Request for CI run (if required)
        if: steps.get-pr.outputs.ALREADY_CREATED == ''
        env:
          GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
        run: |
          cat << EOF > body.md
            This Pull Request is created automatically to run the CI pipeline for #${PR_NUMBER}

            Please do not alter or merge/close it.

            Feel free to review/comment/discuss the original PR #${PR_NUMBER}.
          EOF

          LABELS=$( (gh pr --repo "${GITHUB_REPOSITORY}" view ${PR_NUMBER}  --json labels --jq '.labels.[].name'; echo run-e2e-tests-in-draft  )| \
          grep -E '^run' | paste -sd , -)
          gh pr --repo "${GITHUB_REPOSITORY}" create --title "CI run for PR #${PR_NUMBER}" \
                                                       --body-file "body.md" \
                                                       --head "${BRANCH}" \
                                                       --base "main" \
                                                       --label ${LABELS} \
                                                       --draft
      - name: Modify the existing pull request (if required)
        if: steps.get-pr.outputs.ALREADY_CREATED != ''
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LABELS_TO_ADD: ${{ steps.get-labels.outputs.LABELS_TO_ADD }}
          LABELS_TO_REMOVE: ${{ steps.get-labels.outputs.LABELS_TO_REMOVE }}
          ALREADY_CREATED: ${{ steps.get-pr.outputs.ALREADY_CREATED }}
        run: |
          ADD_CMD=
          REMOVE_CMD=
          [ -z "${LABELS_TO_ADD}" ] || ADD_CMD="--add-label ${LABELS_TO_ADD}"
          [ -z "${LABELS_TO_REMOVE}" ] || REMOVE_CMD="--remove-label ${LABELS_TO_REMOVE}"
          if [ -n "${ADD_CMD}" ] || [ -n "${REMOVE_CMD}" ]; then
            gh pr --repo "${GITHUB_REPOSITORY}" edit ${ALREADY_CREATED} ${ADD_CMD} ${REMOVE_CMD}
          fi

      - run: git push --force origin "${BRANCH}"
        if: steps.get-pr.outputs.ALREADY_CREATED != ''

  cleanup:
    # Close PRs and delete branchs if the original PR is closed.

    permissions:
      contents: write # for `--delete-branch` flag in `gh pr close`
      pull-requests: write # for `gh pr close`

    if: |
      github.event.action == 'closed' &&
      github.event.pull_request.head.repo.full_name != github.repository

    runs-on: ubuntu-22.04

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - name: Close PR and delete `ci-run/pr-${{ env.PR_NUMBER }}` branch
        run: |
          CLOSED="$(gh pr --repo ${GITHUB_REPOSITORY} list --head ${BRANCH} --json 'closed' --jq '.[].closed')"
          if [ "${CLOSED}" == "false" ]; then
            gh pr --repo "${GITHUB_REPOSITORY}" close "${BRANCH}" --delete-branch
          fi


================================================
FILE: .github/workflows/benchbase_tpcc.yml
================================================
name: TPC-C like benchmark using benchbase

on:
  schedule:
    # * is a special character in YAML so you have to quote this string
    #          ┌───────────── minute (0 - 59)
    #          │ ┌───────────── hour (0 - 23)
    #          │ │ ┌───────────── day of the month (1 - 31)
    #          │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
    #          │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
    - cron:   '0 6 * * *' # run once a day at 6 AM UTC
  workflow_dispatch: # adds ability to run this manually

defaults:
  run:
    shell: bash -euxo pipefail {0}

concurrency:
  # Allow only one workflow globally because we do not want to be too noisy in production environment
  group: benchbase-tpcc-workflow
  cancel-in-progress: false

permissions:
  contents: read

jobs:
  benchbase-tpcc:
    strategy:
      fail-fast: false # allow other variants to continue even if one fails
      matrix:
        include:
          - warehouses: 50 # defines number of warehouses and is used to compute number of terminals
            max_rate: 800  # measured max TPS at scale factor based on experiments. Adjust if performance is better/worse
            min_cu: 0.25   # simulate free tier plan (0.25 -2 CU)
            max_cu: 2
          - warehouses: 500 # serverless plan (2-8 CU)
            max_rate: 2000
            min_cu: 2
            max_cu: 8
          - warehouses: 1000 # business plan (2-16 CU)
            max_rate: 2900
            min_cu: 2
            max_cu: 16
      max-parallel: 1 # we want to run each workload size sequentially to avoid noisy neighbors
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    env:
      PG_CONFIG: /tmp/neon/pg_install/v17/bin/pg_config
      PSQL: /tmp/neon/pg_install/v17/bin/psql
      PG_17_LIB_PATH: /tmp/neon/pg_install/v17/lib
      POSTGRES_VERSION: 17
    runs-on: [ self-hosted, us-east-2, x64 ]
    timeout-minutes: 1440

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials # necessary to download artefacts
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours is currently max associated with IAM role

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Create Neon Project
      id: create-neon-project-tpcc
      uses: ./.github/actions/neon-project-create
      with:
        region_id: aws-us-east-2
        postgres_version: ${{ env.POSTGRES_VERSION }}
        compute_units: '[${{ matrix.min_cu }}, ${{ matrix.max_cu }}]'
        api_key: ${{ secrets.NEON_PRODUCTION_API_KEY_4_BENCHMARKS }}
        api_host: console.neon.tech  # production (!)

    - name: Initialize Neon project
      env:
          BENCHMARK_TPCC_CONNSTR: ${{ steps.create-neon-project-tpcc.outputs.dsn }}
          PROJECT_ID: ${{ steps.create-neon-project-tpcc.outputs.project_id }}
      run: |
        echo "Initializing Neon project with project_id: ${PROJECT_ID}"
        export LD_LIBRARY_PATH=${PG_17_LIB_PATH}
        
        # Retry logic for psql connection with 1 minute sleep between attempts
        for attempt in {1..3}; do
          echo "Attempt ${attempt}/3: Creating extensions in Neon project"
          if ${PSQL} "${BENCHMARK_TPCC_CONNSTR}" -c "CREATE EXTENSION IF NOT EXISTS neon; CREATE EXTENSION IF NOT EXISTS neon_utils;"; then
            echo "Successfully created extensions"
            break
          else
            echo "Failed to create extensions on attempt ${attempt}"
            if [ ${attempt} -lt 3 ]; then
              echo "Waiting 60 seconds before retry..."
              sleep 60
            else
              echo "All attempts failed, exiting"
              exit 1
            fi
          fi
        done
        
        echo "BENCHMARK_TPCC_CONNSTR=${BENCHMARK_TPCC_CONNSTR}" >> $GITHUB_ENV

    - name: Generate BenchBase workload configuration
      env:
        WAREHOUSES: ${{ matrix.warehouses }}
        MAX_RATE: ${{ matrix.max_rate }}
      run: |
        echo "Generating BenchBase configs for warehouses: ${WAREHOUSES}, max_rate: ${MAX_RATE}"
        
        # Extract hostname and password from connection string
        # Format: postgresql://username:password@hostname/database?params (no port for Neon)
        HOSTNAME=$(echo "${BENCHMARK_TPCC_CONNSTR}" | sed -n 's|.*://[^:]*:[^@]*@\([^/]*\)/.*|\1|p')
        PASSWORD=$(echo "${BENCHMARK_TPCC_CONNSTR}" | sed -n 's|.*://[^:]*:\([^@]*\)@.*|\1|p')
        
        echo "Extracted hostname: ${HOSTNAME}"
        
        # Use runner temp (NVMe) as working directory
        cd "${RUNNER_TEMP}"
        
        # Copy the generator script
        cp "${GITHUB_WORKSPACE}/test_runner/performance/benchbase_tpc_c_helpers/generate_workload_size.py" .
        
        # Generate configs and scripts
        python3 generate_workload_size.py \
          --warehouses ${WAREHOUSES} \
          --max-rate ${MAX_RATE} \
          --hostname ${HOSTNAME} \
          --password ${PASSWORD} \
          --runner-arch ${{ runner.arch }}
        
        # Fix path mismatch: move generated configs and scripts to expected locations
        mv ../configs ./configs
        mv ../scripts ./scripts

    - name: Prepare database (load data)
      env:
        WAREHOUSES: ${{ matrix.warehouses }}
      run: |
        cd "${RUNNER_TEMP}"
        
        echo "Loading ${WAREHOUSES} warehouses into database..."
        
        # Run the loader script and capture output to log file while preserving stdout/stderr
        ./scripts/load_${WAREHOUSES}_warehouses.sh 2>&1 | tee "load_${WAREHOUSES}_warehouses.log"
        
        echo "Database loading completed"

    - name: Run TPC-C benchmark (warmup phase, then benchmark at 70% of configuredmax TPS)
      env:
        WAREHOUSES: ${{ matrix.warehouses }}
      run: |
        cd "${RUNNER_TEMP}"
        
        echo "Running TPC-C benchmark with ${WAREHOUSES} warehouses..."
        
        # Run the optimal rate benchmark
        ./scripts/execute_${WAREHOUSES}_warehouses_opt_rate.sh
        
        echo "Benchmark execution completed"

    - name: Run TPC-C benchmark (warmup phase, then ramp down TPS and up again in 5 minute intervals)

      env:
          WAREHOUSES: ${{ matrix.warehouses }}
      run: |
        cd "${RUNNER_TEMP}"
        
        echo "Running TPC-C ramp-down-up with ${WAREHOUSES} warehouses..."
        
        # Run the optimal rate benchmark
        ./scripts/execute_${WAREHOUSES}_warehouses_ramp_up.sh
        
        echo "Benchmark execution completed"

    - name: Process results (upload to test results database and generate diagrams)
      env:
        WAREHOUSES: ${{ matrix.warehouses }}
        MIN_CU: ${{ matrix.min_cu }}
        MAX_CU: ${{ matrix.max_cu }}
        PROJECT_ID: ${{ steps.create-neon-project-tpcc.outputs.project_id }}
        REVISION: ${{ github.sha }}
        PERF_DB_CONNSTR: ${{ secrets.PERF_TEST_RESULT_CONNSTR }}
      run: |
        cd "${RUNNER_TEMP}"
        
        echo "Creating temporary Python environment for results processing..."
        
        # Create temporary virtual environment
        python3 -m venv temp_results_env
        source temp_results_env/bin/activate
        
        # Install required packages in virtual environment
        pip install matplotlib pandas psycopg2-binary
        
        echo "Copying results processing scripts..."
        
        # Copy both processing scripts
        cp "${GITHUB_WORKSPACE}/test_runner/performance/benchbase_tpc_c_helpers/generate_diagrams.py" .
        cp "${GITHUB_WORKSPACE}/test_runner/performance/benchbase_tpc_c_helpers/upload_results_to_perf_test_results.py" .
        
        echo "Processing load phase metrics..."
        
        # Find and process load log
        LOAD_LOG=$(find . -name "load_${WAREHOUSES}_warehouses.log" -type f | head -1)
        if [ -n "$LOAD_LOG" ]; then
          echo "Processing load metrics from: $LOAD_LOG"
          python upload_results_to_perf_test_results.py \
            --load-log "$LOAD_LOG" \
            --run-type "load" \
            --warehouses "${WAREHOUSES}" \
            --min-cu "${MIN_CU}" \
            --max-cu "${MAX_CU}" \
            --project-id "${PROJECT_ID}" \
            --revision "${REVISION}" \
            --connection-string "${PERF_DB_CONNSTR}"
        else
          echo "Warning: Load log file not found: load_${WAREHOUSES}_warehouses.log"
        fi
        
        echo "Processing warmup results for optimal rate..."
        
        # Find and process warmup results
        WARMUP_CSV=$(find results_warmup -name "*.results.csv" -type f | head -1)
        WARMUP_JSON=$(find results_warmup -name "*.summary.json" -type f | head -1)
        
        if [ -n "$WARMUP_CSV" ] && [ -n "$WARMUP_JSON" ]; then
          echo "Generating warmup diagram from: $WARMUP_CSV"
          python generate_diagrams.py \
            --input-csv "$WARMUP_CSV" \
            --output-svg "warmup_${WAREHOUSES}_warehouses_performance.svg" \
            --title-suffix "Warmup at max TPS"
            
          echo "Uploading warmup metrics from: $WARMUP_JSON"
          python upload_results_to_perf_test_results.py \
            --summary-json "$WARMUP_JSON" \
            --results-csv "$WARMUP_CSV" \
            --run-type "warmup" \
            --min-cu "${MIN_CU}" \
            --max-cu "${MAX_CU}" \
            --project-id "${PROJECT_ID}" \
            --revision "${REVISION}" \
            --connection-string "${PERF_DB_CONNSTR}"
        else
          echo "Warning: Missing warmup results files (CSV: $WARMUP_CSV, JSON: $WARMUP_JSON)"
        fi
        
        echo "Processing optimal rate results..."
        
        # Find and process optimal rate results  
        OPTRATE_CSV=$(find results_opt_rate -name "*.results.csv" -type f | head -1)
        OPTRATE_JSON=$(find results_opt_rate -name "*.summary.json" -type f | head -1)
        
        if [ -n "$OPTRATE_CSV" ] && [ -n "$OPTRATE_JSON" ]; then
          echo "Generating optimal rate diagram from: $OPTRATE_CSV"
          python generate_diagrams.py \
            --input-csv "$OPTRATE_CSV" \
            --output-svg "benchmark_${WAREHOUSES}_warehouses_performance.svg" \
            --title-suffix "70% of max TPS"
            
          echo "Uploading optimal rate metrics from: $OPTRATE_JSON"
          python upload_results_to_perf_test_results.py \
            --summary-json "$OPTRATE_JSON" \
            --results-csv "$OPTRATE_CSV" \
            --run-type "opt-rate" \
            --min-cu "${MIN_CU}" \
            --max-cu "${MAX_CU}" \
            --project-id "${PROJECT_ID}" \
            --revision "${REVISION}" \
            --connection-string "${PERF_DB_CONNSTR}"
        else
          echo "Warning: Missing optimal rate results files (CSV: $OPTRATE_CSV, JSON: $OPTRATE_JSON)"
        fi

        echo "Processing warmup 2 results for ramp down/up phase..."
        
        # Find and process warmup results
        WARMUP_CSV=$(find results_warmup -name "*.results.csv" -type f | tail -1)
        WARMUP_JSON=$(find results_warmup -name "*.summary.json" -type f | tail -1)
        
        if [ -n "$WARMUP_CSV" ] && [ -n "$WARMUP_JSON" ]; then
          echo "Generating warmup diagram from: $WARMUP_CSV"
          python generate_diagrams.py \
            --input-csv "$WARMUP_CSV" \
            --output-svg "warmup_2_${WAREHOUSES}_warehouses_performance.svg" \
            --title-suffix "Warmup at max TPS"
            
          echo "Uploading warmup metrics from: $WARMUP_JSON"
          python upload_results_to_perf_test_results.py \
            --summary-json "$WARMUP_JSON" \
            --results-csv "$WARMUP_CSV" \
            --run-type "warmup" \
            --min-cu "${MIN_CU}" \
            --max-cu "${MAX_CU}" \
            --project-id "${PROJECT_ID}" \
            --revision "${REVISION}" \
            --connection-string "${PERF_DB_CONNSTR}"
        else
          echo "Warning: Missing warmup results files (CSV: $WARMUP_CSV, JSON: $WARMUP_JSON)"
        fi
        
        echo "Processing ramp results..."
        
        # Find and process ramp results  
        RAMPUP_CSV=$(find results_ramp_up -name "*.results.csv" -type f | head -1)
        RAMPUP_JSON=$(find results_ramp_up -name "*.summary.json" -type f | head -1)
        
        if [ -n "$RAMPUP_CSV" ] && [ -n "$RAMPUP_JSON" ]; then
          echo "Generating ramp diagram from: $RAMPUP_CSV"
          python generate_diagrams.py \
            --input-csv "$RAMPUP_CSV" \
            --output-svg "ramp_${WAREHOUSES}_warehouses_performance.svg" \
            --title-suffix "ramp TPS down and up in 5 minute intervals"
            
          echo "Uploading ramp metrics from: $RAMPUP_JSON"
          python upload_results_to_perf_test_results.py \
            --summary-json "$RAMPUP_JSON" \
            --results-csv "$RAMPUP_CSV" \
            --run-type "ramp-up" \
            --min-cu "${MIN_CU}" \
            --max-cu "${MAX_CU}" \
            --project-id "${PROJECT_ID}" \
            --revision "${REVISION}" \
            --connection-string "${PERF_DB_CONNSTR}"
        else
          echo "Warning: Missing ramp results files (CSV: $RAMPUP_CSV, JSON: $RAMPUP_JSON)"
        fi
        
        # Deactivate and clean up virtual environment
        deactivate
        rm -rf temp_results_env
        rm upload_results_to_perf_test_results.py
        
        echo "Results processing completed and environment cleaned up"

    - name: Set date for upload
      id: set-date
      run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT

    - name: Configure AWS credentials # necessary to upload results
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: us-east-2
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 900 # 900 is minimum value 
        
    - name: Upload benchmark results to S3
      env:
        S3_BUCKET: neon-public-benchmark-results
        S3_PREFIX: benchbase-tpc-c/${{ steps.set-date.outputs.date }}/${{ github.run_id }}/${{ matrix.warehouses }}-warehouses
      run: |
        echo "Redacting passwords from configuration files before upload..."
        
        # Mask all passwords in XML config files
        find "${RUNNER_TEMP}/configs" -name "*.xml" -type f -exec sed -i 's|<password>[^<]*</password>|<password>redacted</password>|g' {} \;
        
        echo "Uploading benchmark results to s3://${S3_BUCKET}/${S3_PREFIX}/"
        
        # Upload the entire benchmark directory recursively
        aws s3 cp --only-show-errors --recursive "${RUNNER_TEMP}" s3://${S3_BUCKET}/${S3_PREFIX}/
        
        echo "Upload completed"
        
    - name: Delete Neon Project
      if: ${{ always() }}
      uses: ./.github/actions/neon-project-delete
      with:
        project_id: ${{ steps.create-neon-project-tpcc.outputs.project_id }}
        api_key: ${{ secrets.NEON_PRODUCTION_API_KEY_4_BENCHMARKS }} 
        api_host: console.neon.tech  # production (!)

================================================
FILE: .github/workflows/benchmarking.yml
================================================
name: Benchmarking

on:
  # uncomment to run on push for debugging your PR
  # push:
  #   branches: [ your branch ]
  schedule:
    # * is a special character in YAML so you have to quote this string
    #          ┌───────────── minute (0 - 59)
    #          │ ┌───────────── hour (0 - 23)
    #          │ │ ┌───────────── day of the month (1 - 31)
    #          │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
    #          │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
    - cron:   '0 3 * * *' # run once a day, timezone is utc
  workflow_dispatch: # adds ability to run this manually
    inputs:
      region_id:
        description: 'Project region id. If not set, the default region will be used'
        required: false
        default: 'aws-us-east-2'
      save_perf_report:
        type: boolean
        description: 'Publish perf report. If not set, the report will be published only for the main branch'
        required: false
      collect_olap_explain:
        type: boolean
        description: 'Collect EXPLAIN ANALYZE for OLAP queries. If not set, EXPLAIN ANALYZE will not be collected'
        required: false
        default: false
      collect_pg_stat_statements:
        type: boolean
        description: 'Collect pg_stat_statements for OLAP queries. If not set, pg_stat_statements will not be collected'
        required: false
        default: false
      run_AWS_RDS_AND_AURORA:
        type: boolean
        description: 'AWS-RDS and AWS-AURORA normally only run on Saturday. Set this to true to run them on every workflow_dispatch'
        required: false
        default: false
      run_only_pgvector_tests:
        type: boolean
        description: 'Run pgvector tests but no other tests. If not set, all tests including pgvector tests will be run'
        required: false
        default: false

defaults:
  run:
    shell: bash -euxo pipefail {0}

concurrency:
  # Allow only one workflow per any non-`main` branch.
  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
  cancel-in-progress: true

jobs:
  cleanup:
    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init
    env:
      ORG_ID: org-solitary-dew-09443886
      LIMIT: 100
      SEARCH: "GITHUB_RUN_ID="
      BASE_URL: https://console-stage.neon.build/api/v2
      DRY_RUN: "false"  # Set to "true" to just test out the workflow

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Cleanup inactive Neon projects left over from prior runs
      env:
        API_KEY: ${{ secrets.NEON_STAGING_API_KEY }}
      run: |
        set -euo pipefail

        NOW=$(date -u +%s)
        DAYS_AGO=$((NOW - 5 * 86400))

        REQUEST_URL="$BASE_URL/projects?limit=$LIMIT&search=$(printf '%s' "$SEARCH" | jq -sRr @uri)&org_id=$ORG_ID"

        echo "Requesting project list from:"
        echo "$REQUEST_URL"

        response=$(curl -s -X GET "$REQUEST_URL" \
          --header "Accept: application/json" \
          --header "Content-Type: application/json" \
          --header "Authorization: Bearer ${API_KEY}" )

        echo "Response:"
        echo "$response" | jq .

        projects_to_delete=$(echo "$response" | jq --argjson cutoff "$DAYS_AGO" '
          .projects[]
          | select(.compute_last_active_at != null)
          | select((.compute_last_active_at | fromdateiso8601) < $cutoff)
          | {id, name, compute_last_active_at}
        ')

        if [ -z "$projects_to_delete" ]; then
          echo "No projects eligible for deletion."
          exit 0
        fi

        echo "Projects that will be deleted:"
        echo "$projects_to_delete" | jq -r '.id'

        if [ "$DRY_RUN" = "false" ]; then
          echo "$projects_to_delete" | jq -r '.id' | while read -r project_id; do
            echo "Deleting project: $project_id"
            curl -s -X DELETE "$BASE_URL/projects/$project_id" \
              --header "Accept: application/json" \
              --header "Content-Type: application/json" \
              --header "Authorization: Bearer ${API_KEY}" 
          done
        else
          echo "Dry run enabled — no projects were deleted."
        fi
  bench:
    if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    strategy:
      fail-fast: false
      matrix:
        include:
          - PG_VERSION: 16
            PLATFORM: "neon-staging"
            region_id: ${{ github.event.inputs.region_id || 'aws-us-east-2' }}
            RUNNER: [ self-hosted, us-east-2, x64 ]
          - PG_VERSION: 17
            PLATFORM: "neon-staging"
            region_id: ${{ github.event.inputs.region_id || 'aws-us-east-2' }}
            RUNNER: [ self-hosted, us-east-2, x64 ]
          - PG_VERSION: 16
            PLATFORM: "azure-staging"
            region_id: 'azure-eastus2'
            RUNNER: [ self-hosted, eastus2, x64 ]
    env:
      TEST_PG_BENCH_DURATIONS_MATRIX: "300"
      TEST_PG_BENCH_SCALES_MATRIX: "10,100"
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      PG_VERSION: ${{ matrix.PG_VERSION }}
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: ${{ matrix.PLATFORM }}

    runs-on: ${{ matrix.RUNNER }}
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials # necessary on Azure runners
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Create Neon Project
      id: create-neon-project
      uses: ./.github/actions/neon-project-create
      with:
        region_id: ${{ matrix.region_id }}
        postgres_version: ${{ env.PG_VERSION }}
        api_key: ${{ secrets.NEON_STAGING_API_KEY }}

    - name: Run benchmark
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        # Set --sparse-ordering option of pytest-order plugin
        # to ensure tests are running in order of appears in the file.
        # It's important for test_perf_pgbench.py::test_pgbench_remote_* tests
        extra_params:
          -m remote_cluster
          --sparse-ordering
          --timeout 14400
          --ignore test_runner/performance/test_perf_olap.py
          --ignore test_runner/performance/test_perf_pgvector_queries.py
          --ignore test_runner/performance/test_logical_replication.py
          --ignore test_runner/performance/test_physical_replication.py
          --ignore test_runner/performance/test_perf_ingest_using_pgcopydb.py
          --ignore test_runner/performance/test_cumulative_statistics_persistence.py
          --ignore test_runner/performance/test_perf_many_relations.py
          --ignore test_runner/performance/test_perf_oltp_large_tenant.py
          --ignore test_runner/performance/test_lfc_prewarm.py
      env:
        BENCHMARK_CONNSTR: ${{ steps.create-neon-project.outputs.dsn }}
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"

    - name: Delete Neon Project
      if: ${{ always() }}
      uses: ./.github/actions/neon-project-delete
      with:
        project_id: ${{ steps.create-neon-project.outputs.project_id }}
        api_key: ${{ secrets.NEON_STAGING_API_KEY }}

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Post to a Slack channel
      if: ${{ github.event.schedule && failure() }}
      uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
      with:
        channel-id: "C06KHQVQ7U3" # on-call-qa-staging-stream
        slack-message: |
          Periodic perf testing: ${{ job.status }}
          <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
          <${{ steps.create-allure-report.outputs.report-url }}|Allure report>
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

  cumstats-test:
    if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    env:
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      DEFAULT_PG_VERSION: 17
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: "neon-staging"

    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Verify that cumulative statistics are preserved
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_cumulative_statistics_persistence.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 3600
        pg_version: ${{ env.DEFAULT_PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        NEON_API_KEY: ${{ secrets.NEON_STAGING_API_KEY }}

  replication-tests:
    if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    env:
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      DEFAULT_PG_VERSION: 16
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: "neon-staging"

    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Run Logical Replication benchmarks
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_logical_replication.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 5400
        pg_version: ${{ env.DEFAULT_PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        NEON_API_KEY: ${{ secrets.NEON_STAGING_API_KEY }}
        BENCHMARK_PROJECT_ID_PUB: ${{ vars.BENCHMARK_PROJECT_ID_PUB }}
        BENCHMARK_PROJECT_ID_SUB: ${{ vars.BENCHMARK_PROJECT_ID_SUB }}

    - name: Run Physical Replication benchmarks
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_physical_replication.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 5400
        pg_version: ${{ env.DEFAULT_PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        NEON_API_KEY: ${{ secrets.NEON_STAGING_API_KEY }}

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        store-test-results-into-db: true
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        REGRESS_TEST_RESULT_CONNSTR_NEW: ${{ secrets.REGRESS_TEST_RESULT_CONNSTR_NEW }}

    # Post both success and failure to the Slack channel
    - name: Post to a Slack channel
      if: ${{ github.event.schedule && !cancelled() }}
      uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
      with:
        channel-id: "C06T9AMNDQQ" # on-call-compute-staging-stream
        slack-message: |
          Periodic replication testing: ${{ job.status }}
          <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
          <${{ steps.create-allure-report.outputs.report-url }}|Allure report>
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

  prewarm-test:
    if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    env:
      PROJECT_ID: ${{ vars.PREWARM_PROJECT_ID }}
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      DEFAULT_PG_VERSION: 17
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: "neon-staging"

    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Run prewarm benchmark
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_lfc_prewarm.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 5400
        pg_version: ${{ env.DEFAULT_PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        NEON_API_KEY: ${{ secrets.NEON_STAGING_API_KEY }}

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        store-test-results-into-db: true
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        REGRESS_TEST_RESULT_CONNSTR_NEW: ${{ secrets.REGRESS_TEST_RESULT_CONNSTR_NEW }}

  generate-matrices:
    if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
    # Create matrices for the benchmarking jobs, so we run benchmarks on rds only once a week (on Saturday)
    #
    # Available platforms:
    # - neonvm-captest-new: Freshly created project (1 CU)
    # - neonvm-captest-freetier: Use freetier-sized compute (0.25 CU)
    # - neonvm-captest-azure-new: Freshly created project (1 CU) in azure region
    # - neonvm-captest-azure-freetier: Use freetier-sized compute (0.25 CU) in azure region
    # - neonvm-captest-reuse: Reusing existing project
    # - rds-aurora: Aurora Postgres Serverless v2 with autoscaling from 0.5 to 2 ACUs
    # - rds-postgres: RDS Postgres db.m5.large instance (2 vCPU, 8 GiB) with gp3 EBS storage
    env:
      RUN_AWS_RDS_AND_AURORA: ${{ github.event.inputs.run_AWS_RDS_AND_AURORA || 'false' }}
      DEFAULT_REGION_ID: ${{ github.event.inputs.region_id || 'aws-us-east-2' }}
    runs-on: ubuntu-22.04
    outputs:
      pgbench-compare-matrix: ${{ steps.pgbench-compare-matrix.outputs.matrix }}
      olap-compare-matrix: ${{ steps.olap-compare-matrix.outputs.matrix }}
      tpch-compare-matrix: ${{ steps.tpch-compare-matrix.outputs.matrix }}

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - name: Generate matrix for pgbench benchmark
      id: pgbench-compare-matrix
      run: |
        region_id_default=${{ env.DEFAULT_REGION_ID }}
        runner_default='["self-hosted", "us-east-2", "x64"]'
        runner_azure='["self-hosted", "eastus2", "x64"]'
        image_default="ghcr.io/neondatabase/build-tools:pinned-bookworm"
        matrix='{
          "pg_version" : [
            16
          ],
          "region_id" : [
            "'"$region_id_default"'"
            ],
          "platform": [
            "neonvm-captest-new",
            "neonvm-captest-reuse",
            "neonvm-captest-new"
          ],
          "db_size": [ "10gb" ],
          "runner": ['"$runner_default"'],
          "image": [ "'"$image_default"'" ],
          "include": [{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-freetier",       "db_size": "3gb" ,"runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new",            "db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new-many-tables","db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new",            "db_size": "50gb","runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 16, "region_id": "azure-eastus2",          "platform": "neonvm-azure-captest-freetier", "db_size": "3gb" ,"runner": '"$runner_azure"',   "image": "ghcr.io/neondatabase/build-tools:pinned-bookworm" },
                      { "pg_version": 16, "region_id": "azure-eastus2",          "platform": "neonvm-azure-captest-new",      "db_size": "10gb","runner": '"$runner_azure"',   "image": "ghcr.io/neondatabase/build-tools:pinned-bookworm" },
                      { "pg_version": 16, "region_id": "azure-eastus2",          "platform": "neonvm-azure-captest-new",      "db_size": "50gb","runner": '"$runner_azure"',   "image": "ghcr.io/neondatabase/build-tools:pinned-bookworm" },
                      { "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-sharding-reuse", "db_size": "50gb","runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 17, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-freetier",       "db_size": "3gb" ,"runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 17, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new",            "db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 17, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new-many-tables","db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'"                               },
                      { "pg_version": 17, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new",            "db_size": "50gb","runner": '"$runner_default"', "image": "'"$image_default"'"                               }]
        }'

        if [ "$(date +%A)" = "Saturday" ] || [ ${RUN_AWS_RDS_AND_AURORA} = "true" ]; then
          matrix=$(echo "$matrix" | jq '.include += [{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "rds-postgres", "db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'" },
                                                     { "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "rds-aurora", "db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'" }]')
        fi

        echo "matrix=$(echo "$matrix" | jq --compact-output '.')" >> $GITHUB_OUTPUT

    - name: Generate matrix for OLAP benchmarks
      id: olap-compare-matrix
      run: |
        matrix='{
          "platform": [
            "neonvm-captest-reuse"
          ],
          "pg_version" : [
            16,17
          ]
        }'

        if [ "$(date +%A)" = "Saturday" ] || [ ${RUN_AWS_RDS_AND_AURORA} = "true" ]; then
          matrix=$(echo "$matrix" | jq '.include += [{ "pg_version": 16, "platform": "rds-postgres" },
                                                     { "pg_version": 16, "platform": "rds-aurora"   }]')
        fi

        echo "matrix=$(echo "$matrix" | jq --compact-output '.')" >> $GITHUB_OUTPUT

    - name: Generate matrix for TPC-H benchmarks
      id: tpch-compare-matrix
      run: |
        matrix='{
          "platform": [
            "neonvm-captest-reuse"
          ],
          "pg_version" : [
            16,17
          ]
        }'

        if [ "$(date +%A)" = "Saturday" ] || [ ${RUN_AWS_RDS_AND_AURORA} = "true" ]; then
          matrix=$(echo "$matrix" | jq '.include += [{ "pg_version": 16, "platform": "rds-postgres" },
                                                     { "pg_version": 16, "platform": "rds-aurora"   }]')
        fi

        echo "matrix=$(echo "$matrix" | jq --compact-output '.')" >> $GITHUB_OUTPUT

  prepare_AWS_RDS_databases:
    uses: ./.github/workflows/_benchmarking_preparation.yml
    secrets: inherit

  pgbench-compare:
    if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
    needs: [ generate-matrices, prepare_AWS_RDS_databases ]
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials

    strategy:
      fail-fast: false
      matrix: ${{fromJSON(needs.generate-matrices.outputs.pgbench-compare-matrix)}}

    env:
      TEST_PG_BENCH_DURATIONS_MATRIX: "60m"
      TEST_PG_BENCH_SCALES_MATRIX: ${{ matrix.db_size }}
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      PG_VERSION: ${{ matrix.pg_version }}
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: ${{ matrix.platform }}

    runs-on: ${{ matrix.runner }}
    container:
      image: ${{ matrix.image }}
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    # Increase timeout to 8h, default timeout is 6h
    timeout-minutes: 480

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Create Neon Project
      if: contains(fromJSON('["neonvm-captest-new", "neonvm-captest-new-many-tables", "neonvm-captest-freetier", "neonvm-azure-captest-freetier", "neonvm-azure-captest-new"]'), matrix.platform)
      id: create-neon-project
      uses: ./.github/actions/neon-project-create
      with:
        region_id: ${{ matrix.region_id }}
        postgres_version: ${{ env.PG_VERSION }}
        api_key: ${{ secrets.NEON_STAGING_API_KEY }}
        compute_units: ${{ (contains(matrix.platform, 'captest-freetier') && '[0.25, 0.25]') || '[1, 1]' }}

    - name: Set up Connection String
      id: set-up-connstr
      run: |
        case "${PLATFORM}" in
          neonvm-captest-reuse)
            CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CONNSTR }}
            ;;
          neonvm-captest-sharding-reuse)
            CONNSTR=${{ secrets.BENCHMARK_CAPTEST_SHARDING_CONNSTR }}
            ;;
          neonvm-captest-new | neonvm-captest-new-many-tables | neonvm-captest-freetier | neonvm-azure-captest-new | neonvm-azure-captest-freetier)
            CONNSTR=${{ steps.create-neon-project.outputs.dsn }}
            ;;
          rds-aurora)
            CONNSTR=${{ secrets.BENCHMARK_RDS_AURORA_CONNSTR }}
            ;;
          rds-postgres)
            CONNSTR=${{ secrets.BENCHMARK_RDS_POSTGRES_CONNSTR }}
            ;;
          *)
            echo >&2 "Unknown PLATFORM=${PLATFORM}"
            exit 1
            ;;
        esac

        echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT

    # we want to compare Neon project OLTP throughput and latency at scale factor 10 GB
    # without (neonvm-captest-new)
    # and with (neonvm-captest-new-many-tables) many relations in the database
    - name: Create many relations before the run
      if: contains(fromJSON('["neonvm-captest-new-many-tables"]'), matrix.platform)
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600 -k test_perf_many_relations
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        TEST_NUM_RELATIONS: 10000

    - name: Benchmark init
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600 -k test_pgbench_remote_init
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"

    - name: Benchmark simple-update
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600 -k test_pgbench_remote_simple_update
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"

    - name: Benchmark select-only
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600 -k test_pgbench_remote_select_only
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"

    - name: Delete Neon Project
      if: ${{ steps.create-neon-project.outputs.project_id && always() }}
      uses: ./.github/actions/neon-project-delete
      with:
        project_id: ${{ steps.create-neon-project.outputs.project_id }}
        api_key: ${{ secrets.NEON_STAGING_API_KEY }}

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Post to a Slack channel
      if: ${{ github.event.schedule && failure() }}
      uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
      with:
        channel-id: "C06KHQVQ7U3" # on-call-qa-staging-stream
        slack-message: |
          Periodic perf testing on ${{ matrix.platform }}: ${{ job.status }}
          <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
          <${{ steps.create-allure-report.outputs.report-url }}|Allure report>
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

  pgbench-pgvector:
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    strategy:
      fail-fast: false
      matrix:
        include:
          - PLATFORM: "neonvm-captest-pgvector"
            RUNNER: [ self-hosted, us-east-2, x64 ]
            postgres_version: 16
          - PLATFORM: "neonvm-captest-pgvector-pg17"
            RUNNER: [ self-hosted, us-east-2, x64 ]
            postgres_version: 17
          - PLATFORM: "azure-captest-pgvector"
            RUNNER: [ self-hosted, eastus2, x64 ]
            postgres_version: 16

    env:
      TEST_PG_BENCH_DURATIONS_MATRIX: "15m"
      TEST_PG_BENCH_SCALES_MATRIX: "1"
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      PG_VERSION: ${{ matrix.postgres_version }}
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote

      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: ${{ matrix.PLATFORM }}

    runs-on: ${{ matrix.RUNNER }}
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Set up Connection String
      id: set-up-connstr
      run: |
        case "${PLATFORM}" in
          neonvm-captest-pgvector)
            CONNSTR=${{ secrets.BENCHMARK_PGVECTOR_CONNSTR }}
            ;;
          neonvm-captest-pgvector-pg17)
            CONNSTR=${{ secrets.BENCHMARK_PGVECTOR_CONNSTR_PG17 }}
            ;;
          azure-captest-pgvector)
            CONNSTR=${{ secrets.BENCHMARK_PGVECTOR_CONNSTR_AZURE }}
            ;;
          *)
            echo >&2 "Unknown PLATFORM=${PLATFORM}"
            exit 1
            ;;
        esac

        echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT

    - name: Benchmark pgvector hnsw indexing
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_perf_olap.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600 -k test_pgvector_indexing
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}

    - name: Benchmark pgvector queries
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_perf_pgvector_queries.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Post to a Slack channel
      if: ${{ github.event.schedule && failure() }}
      uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
      with:
        channel-id: "C06KHQVQ7U3" # on-call-qa-staging-stream
        slack-message: |
          Periodic perf testing on ${{ env.PLATFORM }}: ${{ job.status }}
          <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
          <${{ steps.create-allure-report.outputs.report-url }}|Allure report>
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

  clickbench-compare:
    # ClichBench DB for rds-aurora and rds-Postgres deployed to the same clusters
    # we use for performance testing in pgbench-compare.
    # Run this job only when pgbench-compare is finished to avoid the intersection.
    # We might change it after https://github.com/neondatabase/neon/issues/2900.
    #
    # *_CLICKBENCH_CONNSTR: Genuine ClickBench DB with ~100M rows
    # *_CLICKBENCH_10M_CONNSTR: DB with the first 10M rows of ClickBench DB
    if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    needs: [ generate-matrices, pgbench-compare, prepare_AWS_RDS_databases ]

    strategy:
      fail-fast: false
      matrix: ${{ fromJSON(needs.generate-matrices.outputs.olap-compare-matrix) }}

    env:
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      PG_VERSION: ${{ matrix.pg_version }}
      TEST_OUTPUT: /tmp/test_output
      TEST_OLAP_COLLECT_EXPLAIN: ${{ github.event.inputs.collect_olap_explain }}
      TEST_OLAP_COLLECT_PG_STAT_STATEMENTS: ${{ github.event.inputs.collect_pg_stat_statements }}
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: ${{ matrix.platform }}

    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    # Increase timeout to 12h, default timeout is 6h
    # we have regression in clickbench causing it to run 2-3x longer
    timeout-minutes: 720

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Set up Connection String
      id: set-up-connstr
      run: |
        case "${PLATFORM}" in
          neonvm-captest-reuse)
            case "${PG_VERSION}" in
              16)
                CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CLICKBENCH_10M_CONNSTR }}
                ;;
              17)
                CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CLICKBENCH_CONNSTR_PG17 }}
                ;;
              *)
                echo >&2 "Unsupported PG_VERSION=${PG_VERSION} for PLATFORM=${PLATFORM}"
                exit 1
                ;;
            esac
            ;;
          rds-aurora)
            CONNSTR=${{ secrets.BENCHMARK_RDS_AURORA_CLICKBENCH_10M_CONNSTR }}
            ;;
          rds-postgres)
            CONNSTR=${{ secrets.BENCHMARK_RDS_POSTGRES_CLICKBENCH_10M_CONNSTR }}
            ;;
          *)
            echo >&2 "Unknown PLATFORM=${PLATFORM}. Allowed only 'neonvm-captest-reuse', 'rds-aurora', or 'rds-postgres'"
            exit 1
            ;;
        esac

        echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT

    - name: ClickBench benchmark
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_perf_olap.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 43200 -k test_clickbench
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        TEST_OLAP_COLLECT_EXPLAIN: ${{ github.event.inputs.collect_olap_explain || 'false' }}
        TEST_OLAP_COLLECT_PG_STAT_STATEMENTS: ${{ github.event.inputs.collect_pg_stat_statements || 'false' }}
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}
        TEST_OLAP_SCALE: 10

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Post to a Slack channel
      if: ${{ github.event.schedule && failure() }}
      uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
      with:
        channel-id: "C06KHQVQ7U3" # on-call-qa-staging-stream
        slack-message: |
          Periodic OLAP perf testing on ${{ matrix.platform }}: ${{ job.status }}
          <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
          <${{ steps.create-allure-report.outputs.report-url }}|Allure report>
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

  tpch-compare:
    # TCP-H DB for rds-aurora and rds-Postgres deployed to the same clusters
    # we use for performance testing in pgbench-compare & clickbench-compare.
    # Run this job only when clickbench-compare is finished to avoid the intersection.
    # We might change it after https://github.com/neondatabase/neon/issues/2900.
    #
    # *_TPCH_S10_CONNSTR: DB generated with scale factor 10 (~10 GB)
    # if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    needs: [ generate-matrices, clickbench-compare, prepare_AWS_RDS_databases ]

    strategy:
      fail-fast: false
      matrix: ${{ fromJSON(needs.generate-matrices.outputs.tpch-compare-matrix) }}

    env:
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      PG_VERSION: ${{ matrix.pg_version }}
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: ${{ matrix.platform }}

    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Get Connstring Secret Name
      run: |
        case "${PLATFORM}" in
          neonvm-captest-reuse)
            case "${PG_VERSION}" in
              16)
                CONNSTR_SECRET_NAME="BENCHMARK_CAPTEST_TPCH_S10_CONNSTR"
                ;;
              17)
                CONNSTR_SECRET_NAME="BENCHMARK_CAPTEST_TPCH_CONNSTR_PG17"
                ;;
              *)
                echo >&2 "Unsupported PG_VERSION=${PG_VERSION} for PLATFORM=${PLATFORM}"
                exit 1
                ;;
            esac
            ;;
          rds-aurora)
            CONNSTR_SECRET_NAME="BENCHMARK_RDS_AURORA_TPCH_S10_CONNSTR"
            ;;
          rds-postgres)
            CONNSTR_SECRET_NAME="BENCHMARK_RDS_POSTGRES_TPCH_S10_CONNSTR"
            ;;
          *)
            echo >&2 "Unknown PLATFORM=${PLATFORM}. Allowed only 'neonvm-captest-reuse', 'rds-aurora', or 'rds-postgres'"
            exit 1
            ;;
        esac

        echo "CONNSTR_SECRET_NAME=${CONNSTR_SECRET_NAME}" >> $GITHUB_ENV

    - name: Set up Connection String
      id: set-up-connstr
      run: |
        CONNSTR=${{ secrets[env.CONNSTR_SECRET_NAME] }}

        echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT

    - name: Run TPC-H benchmark
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_perf_olap.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600 -k test_tpch
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}
        TEST_OLAP_SCALE: 10

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Post to a Slack channel
      if: ${{ github.event.schedule && failure() }}
      uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
      with:
        channel-id: "C06KHQVQ7U3" # on-call-qa-staging-stream
        slack-message: |
          Periodic TPC-H perf testing on ${{ matrix.platform }}: ${{ job.status }}
          <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
          <${{ steps.create-allure-report.outputs.report-url }}|Allure report>
      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

  user-examples-compare:
    # if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
    permissions:
      contents: write
      statuses: write
      id-token: write # aws-actions/configure-aws-credentials
    needs: [ generate-matrices, tpch-compare, prepare_AWS_RDS_databases ]

    strategy:
      fail-fast: false
      matrix: ${{ fromJSON(needs.generate-matrices.outputs.olap-compare-matrix) }}

    env:
      POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
      PG_VERSION: ${{ matrix.pg_version }}
      TEST_OUTPUT: /tmp/test_output
      BUILD_TYPE: remote
      SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
      PLATFORM: ${{ matrix.platform }}

    runs-on: [ self-hosted, us-east-2, x64 ]
    container:
      image: ghcr.io/neondatabase/build-tools:pinned-bookworm
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
      options: --init

    steps:
    - name: Harden the runner (Audit all outbound calls)
      uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
      with:
        egress-policy: audit

    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        aws-region: eu-central-1
        role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
        role-duration-seconds: 18000 # 5 hours

    - name: Download Neon artifact
      uses: ./.github/actions/download
      with:
        name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
        path: /tmp/neon/
        prefix: latest
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Set up Connection String
      id: set-up-connstr
      run: |
        case "${PLATFORM}" in
          neonvm-captest-reuse)
            case "${PG_VERSION}" in
              16)
                CONNSTR=${{ secrets.BENCHMARK_USER_EXAMPLE_CAPTEST_CONNSTR }}
                ;;
              17)
                CONNSTR=${{ secrets.BENCHMARK_CAPTEST_USER_EXAMPLE_CONNSTR_PG17 }}
                ;;
              *)
                echo >&2 "Unsupported PG_VERSION=${PG_VERSION} for PLATFORM=${PLATFORM}"
                exit 1
                ;;
            esac
            ;;
          rds-aurora)
            CONNSTR=${{ secrets.BENCHMARK_USER_EXAMPLE_RDS_AURORA_CONNSTR }}
            ;;
          rds-postgres)
            CONNSTR=${{ secrets.BENCHMARK_USER_EXAMPLE_RDS_POSTGRES_CONNSTR }}
            ;;
          *)
            echo >&2 "Unknown PLATFORM=${PLATFORM}. Allowed only 'neonvm-captest-reuse', 'rds-aurora', or 'rds-postgres'"
            exit 1
            ;;
        esac

        echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT

    - name: Run user examples
      uses: ./.github/actions/run-python-test-set
      with:
        build_type: ${{ env.BUILD_TYPE }}
        test_selection: performance/test_perf_olap.py
        run_in_parallel: false
        save_perf_report: ${{ env.SAVE_PERF_REPORT }}
        extra_params: -m remote_cluster --timeout 21600 -k test_user_examples
        pg_version: ${{ env.PG_VERSION }}
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
      env:
        VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}"
        PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
        BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }}

    - name: Create Allure report
      id: create-allure-report
      if: ${{ !cancelled() }}
      uses: ./.github/actions/allure-report-generate
      with:
        aws-oidc-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}

    - name: Post to a Slack channel
      if: ${{ github.event.schedule && failure() }}
      uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
      with:
        channel-id: "C06KHQVQ7U3" # on-call-qa-staging-stream
        slack-message: |
          Periodic TPC-H perf testing on ${{ matrix.platform }}: ${{ job.status }}
          <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
          <${{ steps.create-allure-report.outputs.report-url }}|Allure report>

      env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}


================================================
FILE: .github/workflows/build-build-tools-image.yml
================================================
name: Build build-tools image

on:
  workflow_call:
    inputs:
      archs:
        description: "Json array of architectures to build"
        # Default values are set in `check-image` job, `set-variables` step
        type: string
        required: false
      debians:
        description: "Json array of Debian versions to build"
        # Default values are set in `check-image` job, `set-variables` step
        type: string
        required: false
    outputs:
      image-tag:
        description: "build-tools tag"
        value: ${{ jobs.check-image.outputs.tag }}
      image:
        description: "build-tools image"
        value: ghcr.io/neondatabase/build-tools:${{ jobs.check-image.outputs.tag }}

defaults:
  run:
    shell: bash -euo pipefail {0}

# The initial idea was to prevent the waste of resources by not re-building the `build-tools` image
# for the same tag in parallel workflow runs, and queue them to be skipped once we have
# the first image pushed to Docker registry, but GitHub's concurrency mechanism is not working as expected.
# GitHub can't have more than 1 job in a queue and removes the previous one, it causes failures if the dependent jobs.
#
# Ref https://github.com/orgs/community/discussions/41518
#
# concurrency:
#   group: build-build-tools-image-${{ inputs.image-tag }}
#   cancel-in-progress: false

# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
permissions: {}

jobs:
  check-image:
    runs-on: ubuntu-22.04
    outputs:
      archs: ${{ steps.set-variables.outputs.archs }}
      debians: ${{ steps.set-variables.outputs.debians }}
      tag: ${{ steps.set-variables.outputs.image-tag }}
      everything: ${{ steps.set-more-variables.outputs.everything }}
      found: ${{ steps.set-more-variables.outputs.found }}

    permissions:
      packages: read

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Set variables
        id: set-variables
        env:
          ARCHS: ${{ inputs.archs || '["x64","arm64"]' }}
          DEBIANS: ${{ inputs.debians || '["bullseye","bookworm"]' }}
          IMAGE_TAG: |
            ${{ hashFiles('build-tools/Dockerfile',
                          '.github/workflows/build-build-tools-image.yml') }}
        run: |
          echo "archs=${ARCHS}"           | tee -a ${GITHUB_OUTPUT}
          echo "debians=${DEBIANS}"       | tee -a ${GITHUB_OUTPUT}
          echo "image-tag=${IMAGE_TAG}"   | tee -a ${GITHUB_OUTPUT}

      - name: Set more variables
        id: set-more-variables
        env:
          IMAGE_TAG: ${{ steps.set-variables.outputs.image-tag }}
          EVERYTHING: |
            ${{ contains(fromJSON(steps.set-variables.outputs.archs), 'x64') &&
                contains(fromJSON(steps.set-variables.outputs.archs), 'arm64') &&
                contains(fromJSON(steps.set-variables.outputs.debians), 'bullseye') &&
                contains(fromJSON(steps.set-variables.outputs.debians), 'bookworm') }}
        run: |
          if docker manifest inspect ghcr.io/neondatabase/build-tools:${IMAGE_TAG}; then
            found=true
          else
            found=false
          fi

          echo "everything=${EVERYTHING}" | tee -a ${GITHUB_OUTPUT}
          echo "found=${found}"           | tee -a ${GITHUB_OUTPUT}

  build-image:
    needs: [ check-image ]
    if: needs.check-image.outputs.found == 'false'

    strategy:
      matrix:
        arch: ${{ fromJSON(needs.check-image.outputs.archs) }}
        debian: ${{ fromJSON(needs.check-image.outputs.debians) }}

    permissions:
      packages: write

    runs-on: ${{ fromJSON(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - uses: neondatabase/dev-actions/set-docker-config-dir@6094485bf440001c94a94a3f9e221e81ff6b6193
      - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
        with:
          cache-binary: false

      - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
          password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}

      - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          registry: cache.neon.build
          username: ${{ secrets.NEON_CI_DOCKERCACHE_USERNAME }}
          password: ${{ secrets.NEON_CI_DOCKERCACHE_PASSWORD }}

      - uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
        with:
          file: build-tools/Dockerfile
          context: .
          attests: |
            type=provenance,mode=max
            type=sbom,generator=docker.io/docker/buildkit-syft-scanner:1
          push: true
          pull: true
          build-args: |
            DEBIAN_VERSION=${{ matrix.debian }}
          cache-from: type=registry,ref=cache.neon.build/build-tools:cache-${{ matrix.debian }}-${{ matrix.arch }}
          cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/build-tools:cache-{0}-{1},mode=max', matrix.debian, matrix.arch) || '' }}
          tags: |
            ghcr.io/neondatabase/build-tools:${{ needs.check-image.outputs.tag }}-${{ matrix.debian }}-${{ matrix.arch }}

  merge-images:
    needs: [ check-image, build-image ]
    runs-on: ubuntu-22.04

    permissions:
      packages: write

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
          password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}

      - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Create multi-arch image
        env:
          DEFAULT_DEBIAN_VERSION: bookworm
          ARCHS: ${{ join(fromJSON(needs.check-image.outputs.archs), ' ') }}
          DEBIANS: ${{ join(fromJSON(needs.check-image.outputs.debians), ' ') }}
          EVERYTHING: ${{ needs.check-image.outputs.everything }}
          IMAGE_TAG: ${{ needs.check-image.outputs.tag }}
        run: |
          for debian in ${DEBIANS}; do
            tags=("-t" "ghcr.io/neondatabase/build-tools:${IMAGE_TAG}-${debian}")

            if [ "${EVERYTHING}" == "true" ] && [ "${debian}" == "${DEFAULT_DEBIAN_VERSION}" ]; then
              tags+=("-t" "ghcr.io/neondatabase/build-tools:${IMAGE_TAG}")
            fi

            for arch in ${ARCHS}; do
              tags+=("ghcr.io/neondatabase/build-tools:${IMAGE_TAG}-${debian}-${arch}")
            done

            docker buildx imagetools create "${tags[@]}"
          done


================================================
FILE: .github/workflows/build-macos.yml
================================================
name: Check neon with MacOS builds

on:
  workflow_call:
    inputs:
      pg_versions:
        description: "Array of the pg versions to build for, for example: ['v14', 'v17']"
        type: string
        default: '[]'
        required: false
      rebuild_rust_code:
        description: "Rebuild Rust code"
        type: boolean
        default: false
        required: false
      rebuild_everything:
        description: "If true, rebuild for all versions"
        type: boolean
        default: false
        required: false

env:
  RUST_BACKTRACE: 1
  COPT: '-Werror'

# TODO: move `check-*` and `files-changed` jobs to the "Caller" Workflow
# We should care about that as Github has limitations:
# - You can connect up to four levels of workflows
# - You can call a maximum of 20 unique reusable workflows from a single workflow file.
# https://docs.github.com/en/actions/sharing-automations/reusing-workflows#limitations
permissions:
  contents: read

jobs:
  make-all:
    if: |
      inputs.pg_versions != '[]' || inputs.rebuild_rust_code || inputs.rebuild_everything ||
      contains(github.event.pull_request.labels.*.name, 'run-extra-build-macos') ||
      contains(github.event.pull_request.labels.*.name, 'run-extra-build-*') ||
      github.ref_name == 'main'
    timeout-minutes: 60
    runs-on: macos-15
    env:
      # Use release build only, to have less debug info around
      # Hence keeping target/ (and general cache size) smaller
      BUILD_TYPE: release
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - name: Checkout main repo
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          submodules: true
      
      - uses: ./.github/actions/prepare-for-subzero
        with:
          token: ${{ secrets.CI_ACCESS_TOKEN }}

      - name: Install build dependencies
        run: |
          brew install flex bison openssl protobuf icu4c

      - name: Set extra env for macOS
        run: |
          echo 'LDFLAGS=-L/usr/local/opt/openssl@3/lib' >> $GITHUB_ENV
          echo 'CPPFLAGS=-I/usr/local/opt/openssl@3/include' >> $GITHUB_ENV

      - name: Restore "pg_install/" cache
        id: cache_pg
        uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
        with:
          path: pg_install
          key: v1-${{ runner.os }}-${{ runner.arch }}-${{ env.BUILD_TYPE }}-pg-install-v14-${{ hashFiles('Makefile', 'postgres.mk', 'vendor/revisions.json') }}

      - name: Checkout vendor/postgres submodules
        if: steps.cache_pg.outputs.cache-hit != 'true'
        run: |
          git submodule init
          git submodule update --depth 1 --recursive

      - name: Build Postgres
        if: steps.cache_pg.outputs.cache-hit != 'true'
        run: |
          make postgres -j$(sysctl -n hw.ncpu)

      # This isn't strictly necessary, but it makes the cached and non-cached builds more similar,
      # When pg_install is restored from cache, there is no 'build/' directory. By removing it
      # in a non-cached build too, we enforce that the rest of the steps don't depend on it,
      # so that we notice any build caching bugs earlier.
      - name: Remove build artifacts
        if: steps.cache_pg.outputs.cache-hit != 'true'
        run: |
          rm -rf build

      # Explicitly update the rust toolchain before running 'make'. The parallel make build can
      # invoke 'cargo build' more than once in parallel, for different crates.  That's OK, 'cargo'
      # does its own locking to prevent concurrent builds from stepping on each other's
      # toes. However, it will first try to update the toolchain, and that step is not locked the
      # same way. To avoid two toolchain updates running in parallel and stepping on each other's
      # toes, ensure that the toolchain is up-to-date beforehand.
      - name: Update rust toolchain
        run: |
          rustup --version &&
          rustup update &&
          rustup show

      - name: Cache cargo deps
        uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
        with:
          path: |
            ~/.cargo/registry
            !~/.cargo/registry/src
            ~/.cargo/git
            target
          key: v1-${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('./Cargo.lock') }}-${{ hashFiles('./rust-toolchain.toml') }}-rust

      # Build the neon-specific postgres extensions, and all the Rust bits.
      #
      # Pass PG_INSTALL_CACHED=1 because PostgreSQL was already built and cached
      # separately.
      - name: Build all
        run: PG_INSTALL_CACHED=1 BUILD_TYPE=release make -j$(sysctl -n hw.ncpu) all

      - name: Check that no warnings are produced
        run: ./run_clippy.sh


================================================
FILE: .github/workflows/build_and_run_selected_test.yml
================================================
name: Build and Run Selected Test

on:
  workflow_dispatch:
    inputs:
      test-selection:
        description: 'Specification of selected test(s), as accepted by pytest -k'
        required: true
        type: string
      run-count:
        description: 'Number of test runs to perform'
        required: true
        type: number
      archs:
        description: 'Archs to run tests on, e. g.: ["x64", "arm64"]'
        default: '["x64"]'
        required: true
        type: string
      build-types:
        description: 'Build types to ru
Download .txt
gitextract_l6m7x00t/

├── .cargo/
│   └── config.toml
├── .config/
│   ├── hakari.toml
│   └── nextest.toml
├── .dockerignore
├── .git-blame-ignore-revs
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug-template.md
│   │   ├── config.yml
│   │   └── epic-template.md
│   ├── actionlint.yml
│   ├── actions/
│   │   ├── allure-report-generate/
│   │   │   └── action.yml
│   │   ├── allure-report-store/
│   │   │   └── action.yml
│   │   ├── download/
│   │   │   └── action.yml
│   │   ├── neon-branch-create/
│   │   │   └── action.yml
│   │   ├── neon-branch-delete/
│   │   │   └── action.yml
│   │   ├── neon-project-create/
│   │   │   └── action.yml
│   │   ├── neon-project-delete/
│   │   │   └── action.yml
│   │   ├── prepare-for-subzero/
│   │   │   └── action.yml
│   │   ├── run-python-test-set/
│   │   │   └── action.yml
│   │   ├── save-coverage-data/
│   │   │   └── action.yml
│   │   └── upload/
│   │       └── action.yml
│   ├── file-filters.yaml
│   ├── pull_request_template.md
│   ├── scripts/
│   │   ├── generate_image_maps.py
│   │   ├── lint-release-pr.sh
│   │   ├── previous-releases.jq
│   │   └── push_with_image_map.py
│   └── workflows/
│       ├── _benchmarking_preparation.yml
│       ├── _build-and-test-locally.yml
│       ├── _check-codestyle-python.yml
│       ├── _check-codestyle-rust.yml
│       ├── _meta.yml
│       ├── _push-to-container-registry.yml
│       ├── actionlint.yml
│       ├── approved-for-ci-run.yml
│       ├── benchbase_tpcc.yml
│       ├── benchmarking.yml
│       ├── build-build-tools-image.yml
│       ├── build-macos.yml
│       ├── build_and_run_selected_test.yml
│       ├── build_and_test.yml
│       ├── build_and_test_fully.yml
│       ├── build_and_test_with_sanitizers.yml
│       ├── cargo-deny.yml
│       ├── check-permissions.yml
│       ├── cleanup-caches-by-a-branch.yml
│       ├── cloud-extensions.yml
│       ├── cloud-regress.yml
│       ├── fast-forward.yml
│       ├── force-test-extensions-upgrade.yml
│       ├── ingest_benchmark.yml
│       ├── label-for-external-users.yml
│       ├── large_oltp_benchmark.yml
│       ├── large_oltp_growth.yml
│       ├── lint-release-pr.yml
│       ├── neon_extra_builds.yml
│       ├── periodic_pagebench.yml
│       ├── pg-clients.yml
│       ├── pin-build-tools-image.yml
│       ├── pre-merge-checks.yml
│       ├── proxy-benchmark.yml
│       ├── random-ops-test.yml
│       ├── regenerate-pg-setting.yml
│       ├── release-compute.yml
│       ├── release-notify.yml
│       ├── release-proxy.yml
│       ├── release-storage.yml
│       ├── release.yml
│       ├── report-workflow-stats-batch.yml
│       └── trigger-e2e-tests.yml
├── .gitignore
├── .gitmodules
├── .neon_clippy_args
├── CODEOWNERS
├── CONTRIBUTING.md
├── Cargo.toml
├── Dockerfile
├── LICENSE
├── Makefile
├── NOTICE
├── README.md
├── build-tools/
│   ├── Dockerfile
│   ├── package.json
│   └── patches/
│       └── pgcopydbv017.patch
├── clippy.toml
├── compute/
│   ├── .gitignore
│   ├── Makefile
│   ├── README.md
│   ├── compute-node.Dockerfile
│   ├── etc/
│   │   ├── README.md
│   │   ├── ld.so.conf.d/
│   │   │   └── 00-neon.conf
│   │   ├── neon_collector.jsonnet
│   │   ├── neon_collector_autoscaling.jsonnet
│   │   ├── pgbouncer.ini
│   │   ├── postgres_exporter.yml
│   │   ├── sql_exporter/
│   │   │   ├── checkpoints_req.17.sql
│   │   │   ├── checkpoints_req.libsonnet
│   │   │   ├── checkpoints_req.sql
│   │   │   ├── checkpoints_timed.17.sql
│   │   │   ├── checkpoints_timed.libsonnet
│   │   │   ├── checkpoints_timed.sql
│   │   │   ├── compute_backpressure_throttling_seconds_total.libsonnet
│   │   │   ├── compute_backpressure_throttling_seconds_total.sql
│   │   │   ├── compute_current_lsn.libsonnet
│   │   │   ├── compute_current_lsn.sql
│   │   │   ├── compute_getpage_max_inflight_stuck_time_ms.libsonnet
│   │   │   ├── compute_getpage_stuck_requests_total.libsonnet
│   │   │   ├── compute_logical_snapshot_files.libsonnet
│   │   │   ├── compute_logical_snapshot_files.sql
│   │   │   ├── compute_logical_snapshots_bytes.15.sql
│   │   │   ├── compute_logical_snapshots_bytes.libsonnet
│   │   │   ├── compute_logical_snapshots_bytes.sql
│   │   │   ├── compute_max_connections.libsonnet
│   │   │   ├── compute_max_connections.sql
│   │   │   ├── compute_pg_oldest_frozen_xid_age.libsonnet
│   │   │   ├── compute_pg_oldest_frozen_xid_age.sql
│   │   │   ├── compute_pg_oldest_mxid_age.libsonnet
│   │   │   ├── compute_pg_oldest_mxid_age.sql
│   │   │   ├── compute_receive_lsn.libsonnet
│   │   │   ├── compute_receive_lsn.sql
│   │   │   ├── compute_subscriptions_count.libsonnet
│   │   │   ├── compute_subscriptions_count.sql
│   │   │   ├── connection_counts.libsonnet
│   │   │   ├── connection_counts.sql
│   │   │   ├── db_total_size.libsonnet
│   │   │   ├── db_total_size.sql
│   │   │   ├── file_cache_read_wait_seconds_bucket.libsonnet
│   │   │   ├── file_cache_read_wait_seconds_bucket.sql
│   │   │   ├── file_cache_read_wait_seconds_count.libsonnet
│   │   │   ├── file_cache_read_wait_seconds_sum.libsonnet
│   │   │   ├── file_cache_write_wait_seconds_bucket.libsonnet
│   │   │   ├── file_cache_write_wait_seconds_bucket.sql
│   │   │   ├── file_cache_write_wait_seconds_count.libsonnet
│   │   │   ├── file_cache_write_wait_seconds_sum.libsonnet
│   │   │   ├── getpage_prefetch_discards_total.libsonnet
│   │   │   ├── getpage_prefetch_misses_total.libsonnet
│   │   │   ├── getpage_prefetch_requests_total.libsonnet
│   │   │   ├── getpage_prefetches_buffered.libsonnet
│   │   │   ├── getpage_sync_requests_total.libsonnet
│   │   │   ├── getpage_wait_seconds_bucket.libsonnet
│   │   │   ├── getpage_wait_seconds_bucket.sql
│   │   │   ├── getpage_wait_seconds_count.libsonnet
│   │   │   ├── getpage_wait_seconds_sum.libsonnet
│   │   │   ├── lfc_approximate_working_set_size.libsonnet
│   │   │   ├── lfc_approximate_working_set_size.sql
│   │   │   ├── lfc_approximate_working_set_size_windows.autoscaling.libsonnet
│   │   │   ├── lfc_approximate_working_set_size_windows.autoscaling.sql
│   │   │   ├── lfc_approximate_working_set_size_windows.libsonnet
│   │   │   ├── lfc_approximate_working_set_size_windows.sql
│   │   │   ├── lfc_cache_size_limit.libsonnet
│   │   │   ├── lfc_cache_size_limit.sql
│   │   │   ├── lfc_chunk_size.libsonnet
│   │   │   ├── lfc_chunk_size.sql
│   │   │   ├── lfc_hits.libsonnet
│   │   │   ├── lfc_hits.sql
│   │   │   ├── lfc_misses.libsonnet
│   │   │   ├── lfc_misses.sql
│   │   │   ├── lfc_used.libsonnet
│   │   │   ├── lfc_used.sql
│   │   │   ├── lfc_used_pages.libsonnet
│   │   │   ├── lfc_used_pages.sql
│   │   │   ├── lfc_writes.libsonnet
│   │   │   ├── lfc_writes.sql
│   │   │   ├── logical_slot_restart_lsn.libsonnet
│   │   │   ├── logical_slot_restart_lsn.sql
│   │   │   ├── max_cluster_size.libsonnet
│   │   │   ├── max_cluster_size.sql
│   │   │   ├── neon_perf_counters.sql
│   │   │   ├── pageserver_disconnects_total.libsonnet
│   │   │   ├── pageserver_open_requests.libsonnet
│   │   │   ├── pageserver_requests_sent_total.libsonnet
│   │   │   ├── pageserver_send_flushes_total.libsonnet
│   │   │   ├── pg_stats_userdb.libsonnet
│   │   │   ├── pg_stats_userdb.sql
│   │   │   ├── replication_delay_bytes.libsonnet
│   │   │   ├── replication_delay_bytes.sql
│   │   │   ├── replication_delay_seconds.libsonnet
│   │   │   ├── replication_delay_seconds.sql
│   │   │   ├── retained_wal.libsonnet
│   │   │   ├── retained_wal.sql
│   │   │   ├── wal_is_lost.libsonnet
│   │   │   └── wal_is_lost.sql
│   │   └── sql_exporter.jsonnet
│   ├── jsonnet/
│   │   └── neon.libsonnet
│   ├── manifest.schema.json
│   ├── manifest.yaml
│   ├── patches/
│   │   ├── anon_v2.patch
│   │   ├── cloud_regress_pg16.patch
│   │   ├── cloud_regress_pg17.patch
│   │   ├── contrib_pg16.patch
│   │   ├── contrib_pg17.patch
│   │   ├── duckdb_v113.patch
│   │   ├── duckdb_v120.patch
│   │   ├── onnxruntime.patch
│   │   ├── pg_cron.patch
│   │   ├── pg_duckdb_v031.patch
│   │   ├── pg_graphql.patch
│   │   ├── pg_hint_plan_v16.patch
│   │   ├── pg_hint_plan_v17.patch
│   │   ├── pg_repack.patch
│   │   ├── pg_stat_statements_pg14-16.patch
│   │   ├── pg_stat_statements_pg17.patch
│   │   ├── pgaudit-parallel_workers-v14.patch
│   │   ├── pgaudit-parallel_workers-v15.patch
│   │   ├── pgaudit-parallel_workers-v16.patch
│   │   ├── pgaudit-parallel_workers-v17.patch
│   │   ├── pgvector.patch
│   │   ├── plv8_v3.1.10.patch
│   │   ├── plv8_v3.2.3.patch
│   │   ├── postgres_fdw.patch
│   │   └── rum.patch
│   ├── vm-image-spec-bookworm.yaml
│   └── vm-image-spec-bullseye.yaml
├── compute_tools/
│   ├── .dockerignore
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── README.md
│   ├── rustfmt.toml
│   ├── src/
│   │   ├── bin/
│   │   │   ├── compute_ctl.rs
│   │   │   ├── fast_import/
│   │   │   │   ├── aws_s3_sync.rs
│   │   │   │   ├── child_stdio_to_log.rs
│   │   │   │   └── s3_uri.rs
│   │   │   └── fast_import.rs
│   │   ├── catalog.rs
│   │   ├── checker.rs
│   │   ├── communicator_socket_client.rs
│   │   ├── compute.rs
│   │   ├── compute_prewarm.rs
│   │   ├── compute_promote.rs
│   │   ├── config.rs
│   │   ├── config_template/
│   │   │   ├── compute_audit_rsyslog_template.conf
│   │   │   └── compute_rsyslog_postgres_export_template.conf
│   │   ├── configurator.rs
│   │   ├── disk_quota.rs
│   │   ├── extension_server.rs
│   │   ├── hadron_metrics.rs
│   │   ├── http/
│   │   │   ├── extract/
│   │   │   │   ├── json.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── path.rs
│   │   │   │   ├── query.rs
│   │   │   │   └── request_id.rs
│   │   │   ├── headers.rs
│   │   │   ├── middleware/
│   │   │   │   ├── authorize.rs
│   │   │   │   ├── mod.rs
│   │   │   │   └── request_id.rs
│   │   │   ├── mod.rs
│   │   │   ├── openapi_spec.yaml
│   │   │   ├── routes/
│   │   │   │   ├── check_writability.rs
│   │   │   │   ├── configure.rs
│   │   │   │   ├── database_schema.rs
│   │   │   │   ├── dbs_and_roles.rs
│   │   │   │   ├── extension_server.rs
│   │   │   │   ├── extensions.rs
│   │   │   │   ├── failpoints.rs
│   │   │   │   ├── grants.rs
│   │   │   │   ├── hadron_liveness_probe.rs
│   │   │   │   ├── insights.rs
│   │   │   │   ├── lfc.rs
│   │   │   │   ├── metrics.rs
│   │   │   │   ├── metrics_json.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── promote.rs
│   │   │   │   ├── refresh_configuration.rs
│   │   │   │   ├── status.rs
│   │   │   │   └── terminate.rs
│   │   │   └── server.rs
│   │   ├── installed_extensions.rs
│   │   ├── lib.rs
│   │   ├── local_proxy.rs
│   │   ├── logger.rs
│   │   ├── lsn_lease.rs
│   │   ├── metrics.rs
│   │   ├── migration.rs
│   │   ├── migrations/
│   │   │   ├── 0001-add_bypass_rls_to_privileged_role.sql
│   │   │   ├── 0002-alter_roles.sql
│   │   │   ├── 0003-grant_pg_create_subscription_to_privileged_role.sql
│   │   │   ├── 0004-grant_pg_monitor_to_privileged_role.sql
│   │   │   ├── 0005-grant_all_on_tables_to_privileged_role.sql
│   │   │   ├── 0006-grant_all_on_sequences_to_privileged_role.sql
│   │   │   ├── 0007-grant_all_on_tables_with_grant_option_to_privileged_role.sql
│   │   │   ├── 0008-grant_all_on_sequences_with_grant_option_to_privileged_role.sql
│   │   │   ├── 0009-revoke_replication_for_previously_allowed_roles.sql
│   │   │   ├── 0010-grant_snapshot_synchronization_funcs_to_privileged_role.sql
│   │   │   ├── 0011-grant_pg_show_replication_origin_status_to_privileged_role.sql
│   │   │   ├── 0012-grant_pg_signal_backend_to_privileged_role.sql
│   │   │   └── tests/
│   │   │       ├── 0001-add_bypass_rls_to_privileged_role.sql
│   │   │       ├── 0002-alter_roles.sql
│   │   │       ├── 0003-grant_pg_create_subscription_to_privileged_role.sql
│   │   │       ├── 0004-grant_pg_monitor_to_privileged_role.sql
│   │   │       ├── 0005-grant_all_on_tables_to_privileged_role.sql
│   │   │       ├── 0006-grant_all_on_sequences_to_privileged_role.sql
│   │   │       ├── 0007-grant_all_on_tables_with_grant_option_to_privileged_role.sql
│   │   │       ├── 0008-grant_all_on_sequences_with_grant_option_to_privileged_role.sql
│   │   │       ├── 0009-revoke_replication_for_previously_allowed_roles.sql
│   │   │       ├── 0010-grant_snapshot_synchronization_funcs_to_privileged_role.sql
│   │   │       ├── 0011-grant_pg_show_replication_origin_status_to_privileged_role.sql
│   │   │       └── 0012-grant_pg_signal_backend_to_privileged_role.sql
│   │   ├── monitor.rs
│   │   ├── params.rs
│   │   ├── pg_helpers.rs
│   │   ├── pg_isready.rs
│   │   ├── pgbouncer.rs
│   │   ├── rsyslog.rs
│   │   ├── spec.rs
│   │   ├── spec_apply.rs
│   │   ├── sql/
│   │   │   ├── add_availabilitycheck_tables.sql
│   │   │   ├── alter_databricks_reader_roles_timeout.sql
│   │   │   ├── create_databricks_misc.sql
│   │   │   ├── create_privileged_role.sql
│   │   │   ├── default_grants.sql
│   │   │   ├── drop_subscriptions.sql
│   │   │   ├── finalize_drop_subscriptions.sql
│   │   │   ├── pre_drop_role_revoke_privileges.sql
│   │   │   ├── set_public_schema_owner.sql
│   │   │   └── unset_template_for_drop_dbs.sql
│   │   ├── swap.rs
│   │   ├── sync_sk.rs
│   │   └── tls.rs
│   └── tests/
│       ├── README.md
│       ├── cluster_spec.json
│       ├── config_test.rs
│       └── pg_helpers_tests.rs
├── control_plane/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── README.md
│   ├── safekeepers.conf
│   ├── simple.conf
│   ├── src/
│   │   ├── background_process.rs
│   │   ├── bin/
│   │   │   └── neon_local.rs
│   │   ├── branch_mappings.rs
│   │   ├── broker.rs
│   │   ├── endpoint.rs
│   │   ├── endpoint_storage.rs
│   │   ├── lib.rs
│   │   ├── local_env.rs
│   │   ├── pageserver.rs
│   │   ├── postgresql_conf.rs
│   │   ├── safekeeper.rs
│   │   └── storage_controller.rs
│   └── storcon_cli/
│       ├── Cargo.toml
│       └── src/
│           └── main.rs
├── deny.toml
├── diesel.toml
├── docker-compose/
│   ├── README.md
│   ├── compute_wrapper/
│   │   ├── Dockerfile
│   │   ├── private-key.pem
│   │   ├── public-key.der
│   │   ├── public-key.pem
│   │   ├── shell/
│   │   │   └── compute.sh
│   │   └── var/
│   │       └── db/
│   │           └── postgres/
│   │               └── configs/
│   │                   └── config.json
│   ├── docker-compose.yml
│   ├── docker_compose_test.sh
│   ├── ext-src/
│   │   ├── README.md
│   │   ├── alter_db.sh
│   │   ├── h3-pg-src/
│   │   │   ├── neon-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── hll-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── hypopg-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── ip4r-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── online_advisor-src/
│   │   │   ├── neon-test.sh
│   │   │   └── regular-test.sh
│   │   ├── pg_cron-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_graphql-src/
│   │   │   ├── neon-test.sh
│   │   │   └── regular-test.sh
│   │   ├── pg_hint_plan-src/
│   │   │   └── regular-test.sh
│   │   ├── pg_ivm-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── regular.patch
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_jsonschema-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── jsonschema_edge_cases.out
│   │   │   │   └── jsonschema_valid_api.out
│   │   │   └── sql/
│   │   │       ├── jsonschema_edge_cases.sql
│   │   │       └── jsonschema_valid_api.sql
│   │   ├── pg_repack-src/
│   │   │   └── test-upgrade.sh
│   │   ├── pg_roaringbitmap-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_semver-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade-v16.patch
│   │   │   ├── test-upgrade-v17.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pg_session_jwt-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   └── basic_functions.out
│   │   │   └── sql/
│   │   │       └── basic_functions.sql
│   │   ├── pg_tiktoken-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   └── pg_tiktoken.out
│   │   │   └── sql/
│   │   │       └── pg_tiktoken.sql
│   │   ├── pg_uuidv7-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── pgjwt-src/
│   │   │   ├── neon-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pgrag-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── api_keys.out
│   │   │   │   ├── basic_functions.out
│   │   │   │   ├── chunking_functions.out
│   │   │   │   ├── document_processing.out
│   │   │   │   ├── embedding_api_functions.out
│   │   │   │   ├── embedding_functions.out
│   │   │   │   ├── text_processing.out
│   │   │   │   └── voyageai_functions.out
│   │   │   ├── regular-test.sh
│   │   │   └── sql/
│   │   │       ├── api_keys.sql
│   │   │       ├── basic_functions.sql
│   │   │       ├── chunking_functions.sql
│   │   │       ├── document_processing.sql
│   │   │       ├── embedding_api_functions.sql
│   │   │       ├── text_processing.sql
│   │   │       └── voyageai_functions.sql
│   │   ├── pgtap-src/
│   │   │   ├── regular-test.sh
│   │   │   ├── test-upgrade.patch
│   │   │   └── test-upgrade.sh
│   │   ├── pgvector-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── pgx_ulid-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── 00_ulid_generation.out
│   │   │   │   ├── 01_ulid_conversions.out
│   │   │   │   ├── 02_ulid_conversions.out
│   │   │   │   └── 03_ulid_errors.out
│   │   │   └── sql/
│   │   │       ├── 00_ulid_generation.sql
│   │   │       ├── 01_ulid_conversions.sql
│   │   │       ├── 02_ulid_conversions.sql
│   │   │       └── 03_ulid_errors.sql
│   │   ├── plv8-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── postgis-src/
│   │   │   ├── README-Neon.md
│   │   │   ├── neon-test.sh
│   │   │   ├── postgis-common-v16.patch
│   │   │   ├── postgis-common-v17.patch
│   │   │   ├── postgis-regular-v16.patch
│   │   │   ├── postgis-regular-v17.patch
│   │   │   ├── raster_outdb_template.sql
│   │   │   └── regular-test.sh
│   │   ├── postgresql-unit-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── prefix-src/
│   │   │   ├── regular-test.sh
│   │   │   └── test-upgrade.sh
│   │   ├── rag_bge_small_en_v15-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── basic_functions.out
│   │   │   │   ├── basic_functions_enhanced.out
│   │   │   │   ├── embedding_functions.out
│   │   │   │   └── embedding_functions_enhanced.out
│   │   │   └── sql/
│   │   │       ├── basic_functions.sql
│   │   │       ├── basic_functions_enhanced.sql
│   │   │       ├── embedding_functions.sql
│   │   │       └── embedding_functions_enhanced.sql
│   │   ├── rag_jina_reranker_v1_tiny_en-src/
│   │   │   ├── Makefile
│   │   │   ├── expected/
│   │   │   │   ├── reranking_functions.out
│   │   │   │   └── reranking_functions_enhanced.out
│   │   │   └── sql/
│   │   │       ├── reranking_functions.sql
│   │   │       └── reranking_functions_enhanced.sql
│   │   └── rum-src/
│   │       ├── regular-test.sh
│   │       ├── test-upgrade.patch
│   │       └── test-upgrade.sh
│   ├── pageserver_config/
│   │   ├── identity.toml
│   │   └── pageserver.toml
│   ├── run-tests.sh
│   └── test_extensions_upgrade.sh
├── docs/
│   ├── .gitignore
│   ├── SUMMARY.md
│   ├── authentication.md
│   ├── book.toml
│   ├── consumption_metrics.md
│   ├── core_changes.md
│   ├── docker.md
│   ├── error-handling.md
│   ├── glossary.md
│   ├── multitenancy.md
│   ├── pageserver-compaction.md
│   ├── pageserver-page-service.md
│   ├── pageserver-pagecache.md
│   ├── pageserver-processing-getpage.md
│   ├── pageserver-processing-wal.md
│   ├── pageserver-services.md
│   ├── pageserver-storage.md
│   ├── pageserver-tenant-migration.md
│   ├── pageserver-thread-mgmt.md
│   ├── pageserver-walredo.md
│   ├── pageserver.md
│   ├── rfcs/
│   │   ├── 001-cluster-size-limits.md
│   │   ├── 002-storage.md
│   │   ├── 003-laptop-cli.md
│   │   ├── 004-durability.md
│   │   ├── 005-zenith_local.md
│   │   ├── 006-laptop-cli-v2-CLI.md
│   │   ├── 006-laptop-cli-v2-repository-structure.md
│   │   ├── 007-serverless-on-laptop.md
│   │   ├── 008-push-pull.md
│   │   ├── 009-snapshot-first-storage-cli.md
│   │   ├── 009-snapshot-first-storage-pitr.md
│   │   ├── 009-snapshot-first-storage.md
│   │   ├── 010-storage_details.md
│   │   ├── 011-retention-policy.md
│   │   ├── 012-background-tasks.md
│   │   ├── 013-term-history.md
│   │   ├── 014-safekeepers-gossip.md
│   │   ├── 014-storage-lsm.md
│   │   ├── 015-storage-messaging.md
│   │   ├── 016-connection-routing.md
│   │   ├── 017-console-split.md
│   │   ├── 017-timeline-data-management.md
│   │   ├── 018-storage-messaging-2.md
│   │   ├── 019-tenant-timeline-lifecycles.md
│   │   ├── 020-pageserver-s3-coordination.md
│   │   ├── 021-metering.md
│   │   ├── 022-pageserver-delete-from-s3.md
│   │   ├── 023-the-state-of-pageserver-tenant-relocation.md
│   │   ├── 024-extension-loading.md
│   │   ├── 024-user-mgmt.md
│   │   ├── 025-generation-numbers.md
│   │   ├── 026-pageserver-s3-mvcc.md
│   │   ├── 027-crash-consistent-layer-map-through-index-part.md
│   │   ├── 028-pageserver-migration.md
│   │   ├── 029-getpage-throttling.md
│   │   ├── 029-pageserver-wal-disaster-recovery.md
│   │   ├── 030-vectored-timeline-get.md
│   │   ├── 031-sharding-static.md
│   │   ├── 032-shard-splitting.md
│   │   ├── 033-storage-controller-drain-and-fill.md
│   │   ├── 034-ancestor-deletion.md
│   │   ├── 035-safekeeper-dynamic-membership-change.md
│   │   ├── 035-timeline-archive.md
│   │   ├── 036-physical-replication.md
│   │   ├── 037-storage-controller-restarts.md
│   │   ├── 038-aux-file-v2.md
│   │   ├── 038-independent-compute-release.md
│   │   ├── 040-Endpoint-Persistent-Unlogged-Files-Storage.md
│   │   ├── 040-profiling.md
│   │   ├── 041-rel-sparse-keyspace.md
│   │   ├── 041-sharded-ingest.md
│   │   ├── 043-bottom-most-gc-compaction.md
│   │   ├── 044-feature-flag.md
│   │   ├── 2025-02-14-storage-controller.md
│   │   ├── 2025-03-17-compute-prewarm.md
│   │   ├── 2025-04-30-direct-io-for-pageserver.md
│   │   ├── 2025-04-30-pageserver-concurrent-io-on-read-path.md
│   │   ├── 2025-07-07-node-deletion-api-improvement.md
│   │   ├── README.md
│   │   └── YYYY-MM-DD-copy-me.md
│   ├── safekeeper-protocol.md
│   ├── separation-compute-storage.md
│   ├── settings.md
│   ├── sourcetree.md
│   ├── storage_broker.md
│   ├── storage_controller.md
│   ├── synthetic-size.md
│   ├── tools.md
│   ├── updating-postgres.md
│   └── walservice.md
├── endpoint_storage/
│   ├── Cargo.toml
│   └── src/
│       ├── app.rs
│       ├── claims.rs
│       ├── lib.rs
│       ├── main.rs
│       └── openapi_spec.yml
├── libs/
│   ├── compute_api/
│   │   ├── Cargo.toml
│   │   ├── src/
│   │   │   ├── lib.rs
│   │   │   ├── privilege.rs
│   │   │   ├── requests.rs
│   │   │   ├── responses.rs
│   │   │   └── spec.rs
│   │   └── tests/
│   │       └── cluster_spec.json
│   ├── consumption_metrics/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── desim/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── src/
│   │   │   ├── chan.rs
│   │   │   ├── executor.rs
│   │   │   ├── lib.rs
│   │   │   ├── network.rs
│   │   │   ├── node_os.rs
│   │   │   ├── options.rs
│   │   │   ├── proto.rs
│   │   │   ├── time.rs
│   │   │   └── world.rs
│   │   └── tests/
│   │       └── reliable_copy_test.rs
│   ├── http-utils/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── endpoint.rs
│   │       ├── error.rs
│   │       ├── failpoints.rs
│   │       ├── json.rs
│   │       ├── lib.rs
│   │       ├── request.rs
│   │       ├── server.rs
│   │       └── tls_certs.rs
│   ├── metrics/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── hll.rs
│   │       ├── launch_timestamp.rs
│   │       ├── lib.rs
│   │       ├── more_process_metrics.rs
│   │       └── wrappers.rs
│   ├── neon-shmem/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── hash/
│   │       │   ├── core.rs
│   │       │   ├── entry.rs
│   │       │   └── tests.rs
│   │       ├── hash.rs
│   │       ├── lib.rs
│   │       ├── shmem.rs
│   │       └── sync.rs
│   ├── pageserver_api/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── config/
│   │       │   └── tests.rs
│   │       ├── config.rs
│   │       ├── controller_api.rs
│   │       ├── key.rs
│   │       ├── keyspace.rs
│   │       ├── lib.rs
│   │       ├── models/
│   │       │   ├── detach_ancestor.rs
│   │       │   ├── partitioning.rs
│   │       │   └── utilization.rs
│   │       ├── models.rs
│   │       ├── pagestream_api.rs
│   │       ├── reltag.rs
│   │       ├── shard.rs
│   │       └── upcall_api.rs
│   ├── postgres_backend/
│   │   ├── Cargo.toml
│   │   ├── src/
│   │   │   └── lib.rs
│   │   └── tests/
│   │       ├── cert.pem
│   │       ├── key.pem
│   │       └── simple_select.rs
│   ├── postgres_connection/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── postgres_ffi/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── benches/
│   │   │   ├── README.md
│   │   │   └── waldecoder.rs
│   │   ├── bindgen_deps.h
│   │   ├── build.rs
│   │   ├── samples/
│   │   │   └── pg_hba.conf
│   │   ├── src/
│   │   │   ├── controlfile_utils.rs
│   │   │   ├── lib.rs
│   │   │   ├── nonrelfile_utils.rs
│   │   │   ├── pg_constants.rs
│   │   │   ├── pg_constants_v14.rs
│   │   │   ├── pg_constants_v15.rs
│   │   │   ├── pg_constants_v16.rs
│   │   │   ├── pg_constants_v17.rs
│   │   │   ├── relfile_utils.rs
│   │   │   ├── wal_craft_test_export.rs
│   │   │   ├── wal_generator.rs
│   │   │   ├── waldecoder_handler.rs
│   │   │   ├── walrecord.rs
│   │   │   └── xlog_utils.rs
│   │   └── wal_craft/
│   │       ├── Cargo.toml
│   │       └── src/
│   │           ├── bin/
│   │           │   └── wal_craft.rs
│   │           ├── lib.rs
│   │           └── xlog_utils_test.rs
│   ├── postgres_ffi_types/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── constants.rs
│   │       ├── forknum.rs
│   │       └── lib.rs
│   ├── postgres_initdb/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── postgres_versioninfo/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       └── lib.rs
│   ├── posthog_client_lite/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── background_loop.rs
│   │       └── lib.rs
│   ├── pq_proto/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── framed.rs
│   │       └── lib.rs
│   ├── proxy/
│   │   ├── README.md
│   │   ├── json/
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       ├── lib.rs
│   │   │       ├── macros.rs
│   │   │       ├── str.rs
│   │   │       └── value.rs
│   │   ├── postgres-protocol2/
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       ├── authentication/
│   │   │       │   ├── mod.rs
│   │   │       │   └── sasl.rs
│   │   │       ├── escape/
│   │   │       │   ├── mod.rs
│   │   │       │   └── test.rs
│   │   │       ├── lib.rs
│   │   │       ├── message/
│   │   │       │   ├── backend.rs
│   │   │       │   ├── frontend.rs
│   │   │       │   └── mod.rs
│   │   │       ├── password/
│   │   │       │   ├── mod.rs
│   │   │       │   └── test.rs
│   │   │       └── types/
│   │   │           ├── mod.rs
│   │   │           └── test.rs
│   │   ├── postgres-types2/
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       ├── lib.rs
│   │   │       ├── private.rs
│   │   │       └── type_gen.rs
│   │   ├── subzero_core/
│   │   │   ├── .gitignore
│   │   │   ├── Cargo.toml
│   │   │   └── src/
│   │   │       └── lib.rs
│   │   └── tokio-postgres2/
│   │       ├── Cargo.toml
│   │       └── src/
│   │           ├── cancel_query.rs
│   │           ├── cancel_query_raw.rs
│   │           ├── cancel_token.rs
│   │           ├── client.rs
│   │           ├── codec.rs
│   │           ├── config.rs
│   │           ├── connect.rs
│   │           ├── connect_raw.rs
│   │           ├── connect_socket.rs
│   │           ├── connect_tls.rs
│   │           ├── connection.rs
│   │           ├── error/
│   │           │   ├── mod.rs
│   │           │   └── sqlstate.rs
│   │           ├── generic_client.rs
│   │           ├── lib.rs
│   │           ├── maybe_tls_stream.rs
│   │           ├── prepare.rs
│   │           ├── query.rs
│   │           ├── row.rs
│   │           ├── simple_query.rs
│   │           ├── statement.rs
│   │           ├── tls.rs
│   │           ├── transaction.rs
│   │           ├── transaction_builder.rs
│   │           └── types.rs
│   ├── remote_storage/
│   │   ├── Cargo.toml
│   │   ├── src/
│   │   │   ├── azure_blob.rs
│   │   │   ├── config.rs
│   │   │   ├── error.rs
│   │   │   ├── gcs_bucket.rs
│   │   │   ├── lib.rs
│   │   │   ├── local_fs.rs
│   │   │   ├── metrics.rs
│   │   │   ├── s3_bucket.rs
│   │   │   ├── simulate_failures.rs
│   │   │   └── support.rs
│   │   └── tests/
│   │       ├── common/
│   │       │   ├── mod.rs
│   │       │   └── tests.rs
│   │       ├── test_real_azure.rs
│   │       ├── test_real_gcs.rs
│   │       └── test_real_s3.rs
│   ├── safekeeper_api/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── lib.rs
│   │       ├── membership.rs
│   │       └── models.rs
│   ├── tenant_size_model/
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── src/
│   │   │   ├── calculation.rs
│   │   │   ├── lib.rs
│   │   │   └── svg.rs
│   │   └── tests/
│   │       └── tests.rs
│   ├── tracing-utils/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── http.rs
│   │       ├── lib.rs
│   │       └── perf_span.rs
│   ├── utils/
│   │   ├── Cargo.toml
│   │   ├── benches/
│   │   │   ├── README.md
│   │   │   └── benchmarks.rs
│   │   ├── scripts/
│   │   │   ├── restore_from_wal.sh
│   │   │   └── restore_from_wal_initdb.sh
│   │   ├── src/
│   │   │   ├── auth.rs
│   │   │   ├── backoff.rs
│   │   │   ├── bin_ser.rs
│   │   │   ├── circuit_breaker.rs
│   │   │   ├── completion.rs
│   │   │   ├── crashsafe.rs
│   │   │   ├── elapsed_accum.rs
│   │   │   ├── env.rs
│   │   │   ├── error.rs
│   │   │   ├── failpoint_support.rs
│   │   │   ├── fs_ext/
│   │   │   │   └── rename_noreplace.rs
│   │   │   ├── fs_ext.rs
│   │   │   ├── generation.rs
│   │   │   ├── guard_arc_swap.rs
│   │   │   ├── hex.rs
│   │   │   ├── id.rs
│   │   │   ├── ip_address.rs
│   │   │   ├── leaky_bucket.rs
│   │   │   ├── lib.rs
│   │   │   ├── linux_socket_ioctl.rs
│   │   │   ├── lock_file.rs
│   │   │   ├── logging.rs
│   │   │   ├── lsn.rs
│   │   │   ├── measured_stream.rs
│   │   │   ├── metrics_collector.rs
│   │   │   ├── pageserver_feedback.rs
│   │   │   ├── pid_file.rs
│   │   │   ├── poison.rs
│   │   │   ├── postgres_client.rs
│   │   │   ├── rate_limit.rs
│   │   │   ├── sentry_init.rs
│   │   │   ├── seqwait.rs
│   │   │   ├── serde_percent.rs
│   │   │   ├── serde_regex.rs
│   │   │   ├── serde_system_time.rs
│   │   │   ├── shard.rs
│   │   │   ├── signals.rs
│   │   │   ├── simple_rcu.rs
│   │   │   ├── span.rs
│   │   │   ├── sync/
│   │   │   │   ├── duplex/
│   │   │   │   │   └── mpsc.rs
│   │   │   │   ├── duplex.rs
│   │   │   │   ├── gate.rs
│   │   │   │   ├── heavier_once_cell.rs
│   │   │   │   └── spsc_fold.rs
│   │   │   ├── sync.rs
│   │   │   ├── tcp_listener.rs
│   │   │   ├── timeout.rs
│   │   │   ├── toml_edit_ext.rs
│   │   │   ├── tracing_span_assert.rs
│   │   │   ├── try_rcu.rs
│   │   │   ├── vec_map.rs
│   │   │   ├── yielding_loop.rs
│   │   │   └── zstd.rs
│   │   └── tests/
│   │       └── bin_ser_test.rs
│   ├── vm_monitor/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── bin/
│   │       │   └── monitor.rs
│   │       ├── cgroup.rs
│   │       ├── dispatcher.rs
│   │       ├── filecache.rs
│   │       ├── lib.rs
│   │       ├── protocol.rs
│   │       └── runner.rs
│   ├── wal_decoder/
│   │   ├── Cargo.toml
│   │   ├── benches/
│   │   │   ├── README.md
│   │   │   └── bench_interpret_wal.rs
│   │   ├── build.rs
│   │   ├── proto/
│   │   │   └── interpreted_wal.proto
│   │   └── src/
│   │       ├── decoder.rs
│   │       ├── lib.rs
│   │       ├── models/
│   │       │   ├── record.rs
│   │       │   └── value.rs
│   │       ├── models.rs
│   │       ├── serialized_batch.rs
│   │       └── wire_format.rs
│   └── walproposer/
│       ├── Cargo.toml
│       ├── bindgen_deps.h
│       ├── build.rs
│       └── src/
│           ├── api_bindings.rs
│           ├── lib.rs
│           └── walproposer.rs
├── pageserver/
│   ├── Cargo.toml
│   ├── benches/
│   │   ├── README.md
│   │   ├── bench_ingest.rs
│   │   ├── bench_layer_map.rs
│   │   ├── bench_metrics.rs
│   │   ├── bench_walredo.rs
│   │   ├── large-layer-map-layernames.txt
│   │   ├── odd-brook-layernames.txt
│   │   └── upload_queue.rs
│   ├── client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── lib.rs
│   │       ├── mgmt_api/
│   │       │   └── util.rs
│   │       ├── mgmt_api.rs
│   │       └── page_service.rs
│   ├── client_grpc/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── client.rs
│   │       ├── lib.rs
│   │       ├── pool.rs
│   │       └── retry.rs
│   ├── compaction/
│   │   ├── Cargo.toml
│   │   ├── TODO.md
│   │   ├── src/
│   │   │   ├── bin/
│   │   │   │   └── compaction-simulator.rs
│   │   │   ├── compact_tiered.rs
│   │   │   ├── helpers.rs
│   │   │   ├── identify_levels.rs
│   │   │   ├── interface.rs
│   │   │   ├── lib.rs
│   │   │   ├── simulator/
│   │   │   │   └── draw.rs
│   │   │   └── simulator.rs
│   │   └── tests/
│   │       └── tests.rs
│   ├── ctl/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── download_remote_object.rs
│   │       ├── draw_timeline_dir.rs
│   │       ├── index_part.rs
│   │       ├── key.rs
│   │       ├── layer_map_analyzer.rs
│   │       ├── layers.rs
│   │       ├── main.rs
│   │       └── page_trace.rs
│   ├── page_api/
│   │   ├── Cargo.toml
│   │   ├── build.rs
│   │   ├── proto/
│   │   │   └── page_service.proto
│   │   └── src/
│   │       ├── client.rs
│   │       ├── lib.rs
│   │       ├── model.rs
│   │       └── split.rs
│   ├── pagebench/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── cmd/
│   │       │   ├── aux_files.rs
│   │       │   ├── basebackup.rs
│   │       │   ├── getpage_latest_lsn.rs
│   │       │   ├── idle_streams.rs
│   │       │   ├── ondemand_download_churn.rs
│   │       │   └── trigger_initial_size_calculation.rs
│   │       ├── main.rs
│   │       └── util/
│   │           ├── cli/
│   │           │   └── targets.rs
│   │           ├── request_stats.rs
│   │           └── tokio_thread_local_stats.rs
│   ├── src/
│   │   ├── assert_u64_eq_usize.rs
│   │   ├── auth.rs
│   │   ├── aux_file.rs
│   │   ├── basebackup.rs
│   │   ├── basebackup_cache.rs
│   │   ├── bin/
│   │   │   ├── pageserver.rs
│   │   │   └── test_helper_slow_client_reads.rs
│   │   ├── config/
│   │   │   └── ignored_fields.rs
│   │   ├── config.rs
│   │   ├── consumption_metrics/
│   │   │   ├── disk_cache.rs
│   │   │   ├── metrics/
│   │   │   │   └── tests.rs
│   │   │   ├── metrics.rs
│   │   │   └── upload.rs
│   │   ├── consumption_metrics.rs
│   │   ├── context.rs
│   │   ├── controller_upcall_client.rs
│   │   ├── deletion_queue/
│   │   │   ├── deleter.rs
│   │   │   ├── list_writer.rs
│   │   │   └── validator.rs
│   │   ├── deletion_queue.rs
│   │   ├── disk_usage_eviction_task.rs
│   │   ├── feature_resolver.rs
│   │   ├── http/
│   │   │   ├── mod.rs
│   │   │   ├── openapi_spec.yml
│   │   │   └── routes.rs
│   │   ├── import_datadir.rs
│   │   ├── l0_flush.rs
│   │   ├── lib.rs
│   │   ├── metrics.rs
│   │   ├── page_cache.rs
│   │   ├── page_service.rs
│   │   ├── pgdatadir_mapping.rs
│   │   ├── span.rs
│   │   ├── statvfs.rs
│   │   ├── task_mgr.rs
│   │   ├── tenant/
│   │   │   ├── blob_io.rs
│   │   │   ├── block_io.rs
│   │   │   ├── checks.rs
│   │   │   ├── config.rs
│   │   │   ├── debug.rs
│   │   │   ├── disk_btree.rs
│   │   │   ├── disk_btree_test_data.rs
│   │   │   ├── ephemeral_file.rs
│   │   │   ├── gc_block.rs
│   │   │   ├── gc_result.rs
│   │   │   ├── layer_map/
│   │   │   │   ├── historic_layer_coverage.rs
│   │   │   │   └── layer_coverage.rs
│   │   │   ├── layer_map.rs
│   │   │   ├── metadata.rs
│   │   │   ├── mgr.rs
│   │   │   ├── remote_timeline_client/
│   │   │   │   ├── download.rs
│   │   │   │   ├── index.rs
│   │   │   │   ├── manifest.rs
│   │   │   │   └── upload.rs
│   │   │   ├── remote_timeline_client.rs
│   │   │   ├── secondary/
│   │   │   │   ├── downloader.rs
│   │   │   │   ├── heatmap.rs
│   │   │   │   ├── heatmap_uploader.rs
│   │   │   │   └── scheduler.rs
│   │   │   ├── secondary.rs
│   │   │   ├── size.rs
│   │   │   ├── storage_layer/
│   │   │   │   ├── batch_split_writer.rs
│   │   │   │   ├── delta_layer.rs
│   │   │   │   ├── errors.rs
│   │   │   │   ├── filter_iterator.rs
│   │   │   │   ├── image_layer.rs
│   │   │   │   ├── inmemory_layer/
│   │   │   │   │   └── vectored_dio_read.rs
│   │   │   │   ├── inmemory_layer.rs
│   │   │   │   ├── layer/
│   │   │   │   │   ├── failpoints.rs
│   │   │   │   │   └── tests.rs
│   │   │   │   ├── layer.rs
│   │   │   │   ├── layer_desc.rs
│   │   │   │   ├── layer_name.rs
│   │   │   │   └── merge_iterator.rs
│   │   │   ├── storage_layer.rs
│   │   │   ├── tasks.rs
│   │   │   ├── throttle.rs
│   │   │   ├── timeline/
│   │   │   │   ├── analysis.rs
│   │   │   │   ├── compaction.rs
│   │   │   │   ├── delete.rs
│   │   │   │   ├── detach_ancestor.rs
│   │   │   │   ├── eviction_task.rs
│   │   │   │   ├── handle.rs
│   │   │   │   ├── heatmap_layers_downloader.rs
│   │   │   │   ├── import_pgdata/
│   │   │   │   │   ├── flow.rs
│   │   │   │   │   ├── importbucket_client.rs
│   │   │   │   │   ├── importbucket_format.rs
│   │   │   │   │   └── index_part_format.rs
│   │   │   │   ├── import_pgdata.rs
│   │   │   │   ├── init.rs
│   │   │   │   ├── layer_manager.rs
│   │   │   │   ├── logical_size.rs
│   │   │   │   ├── offload.rs
│   │   │   │   ├── span.rs
│   │   │   │   ├── uninit.rs
│   │   │   │   ├── walreceiver/
│   │   │   │   │   ├── connection_manager.rs
│   │   │   │   │   └── walreceiver_connection.rs
│   │   │   │   └── walreceiver.rs
│   │   │   ├── timeline.rs
│   │   │   ├── upload_queue.rs
│   │   │   └── vectored_blob_io.rs
│   │   ├── tenant.rs
│   │   ├── utilization.rs
│   │   ├── virtual_file/
│   │   │   ├── io_engine/
│   │   │   │   └── tokio_epoll_uring_ext.rs
│   │   │   ├── io_engine.rs
│   │   │   ├── metadata.rs
│   │   │   ├── open_options.rs
│   │   │   ├── owned_buffers_io/
│   │   │   │   ├── aligned_buffer/
│   │   │   │   │   ├── alignment.rs
│   │   │   │   │   ├── buffer.rs
│   │   │   │   │   ├── buffer_mut.rs
│   │   │   │   │   ├── raw.rs
│   │   │   │   │   └── slice.rs
│   │   │   │   ├── aligned_buffer.rs
│   │   │   │   ├── io_buf_aligned.rs
│   │   │   │   ├── io_buf_ext.rs
│   │   │   │   ├── slice.rs
│   │   │   │   ├── write/
│   │   │   │   │   └── flush.rs
│   │   │   │   └── write.rs
│   │   │   └── temporary.rs
│   │   ├── virtual_file.rs
│   │   ├── walingest.rs
│   │   ├── walredo/
│   │   │   ├── apply_neon.rs
│   │   │   ├── process/
│   │   │   │   ├── no_leak_child.rs
│   │   │   │   └── protocol.rs
│   │   │   └── process.rs
│   │   └── walredo.rs
│   └── test_data/
│       ├── indices/
│       │   └── mixed_workload/
│       │       ├── README.md
│       │       └── index_part.json
│       ├── short_v14_redo.page
│       └── sk_wal_segment_from_pgbench/
│           ├── 000000010000000000000001.zst
│           └── initdb.tar.zst
├── pgxn/
│   ├── .dir-locals.el
│   ├── .editorconfig
│   ├── Makefile
│   ├── neon/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── bitmap.h
│   │   ├── communicator/
│   │   │   ├── .gitignore
│   │   │   ├── Cargo.toml
│   │   │   ├── README.md
│   │   │   ├── build.rs
│   │   │   ├── cbindgen.toml
│   │   │   └── src/
│   │   │       ├── lib.rs
│   │   │       └── worker_process/
│   │   │           ├── callbacks.rs
│   │   │           ├── control_socket.rs
│   │   │           ├── lfc_metrics.rs
│   │   │           ├── logging.rs
│   │   │           ├── main_loop.rs
│   │   │           ├── mod.rs
│   │   │           └── worker_interface.rs
│   │   ├── communicator.c
│   │   ├── communicator.h
│   │   ├── communicator_process.c
│   │   ├── communicator_process.h
│   │   ├── extension_server.c
│   │   ├── extension_server.h
│   │   ├── file_cache.c
│   │   ├── file_cache.h
│   │   ├── hll.c
│   │   ├── hll.h
│   │   ├── libpagestore.c
│   │   ├── libpqwalproposer.h
│   │   ├── logical_replication_monitor.c
│   │   ├── logical_replication_monitor.h
│   │   ├── neon--1.0--1.1.sql
│   │   ├── neon--1.0.sql
│   │   ├── neon--1.1--1.0.sql
│   │   ├── neon--1.1--1.2.sql
│   │   ├── neon--1.2--1.1.sql
│   │   ├── neon--1.2--1.3.sql
│   │   ├── neon--1.3--1.2.sql
│   │   ├── neon--1.3--1.4.sql
│   │   ├── neon--1.4--1.3.sql
│   │   ├── neon--1.4--1.5.sql
│   │   ├── neon--1.5--1.4.sql
│   │   ├── neon--1.5--1.6.sql
│   │   ├── neon--1.6--1.5.sql
│   │   ├── neon.c
│   │   ├── neon.control
│   │   ├── neon.h
│   │   ├── neon_ddl_handler.c
│   │   ├── neon_ddl_handler.h
│   │   ├── neon_lwlsncache.c
│   │   ├── neon_lwlsncache.h
│   │   ├── neon_perf_counters.c
│   │   ├── neon_perf_counters.h
│   │   ├── neon_pgversioncompat.c
│   │   ├── neon_pgversioncompat.h
│   │   ├── neon_utils.c
│   │   ├── neon_utils.h
│   │   ├── neon_walreader.c
│   │   ├── neon_walreader.h
│   │   ├── pagestore_client.h
│   │   ├── pagestore_smgr.c
│   │   ├── relsize_cache.c
│   │   ├── unstable_extensions.c
│   │   ├── unstable_extensions.h
│   │   ├── walproposer.c
│   │   ├── walproposer.h
│   │   ├── walproposer_compat.c
│   │   ├── walproposer_pg.c
│   │   ├── walsender_hooks.c
│   │   └── walsender_hooks.h
│   ├── neon_rmgr/
│   │   ├── Makefile
│   │   ├── neon_rmgr.c
│   │   ├── neon_rmgr.control
│   │   ├── neon_rmgr.h
│   │   ├── neon_rmgr_decode.c
│   │   └── neon_rmgr_desc.c
│   ├── neon_test_utils/
│   │   ├── Makefile
│   │   ├── neon_test_utils--1.3.sql
│   │   ├── neon_test_utils.control
│   │   └── neontest.c
│   ├── neon_utils/
│   │   ├── Makefile
│   │   ├── neon_utils--1.0.sql
│   │   ├── neon_utils.c
│   │   └── neon_utils.control
│   └── neon_walredo/
│       ├── Makefile
│       ├── inmem_smgr.c
│       ├── inmem_smgr.h
│       ├── neon_seccomp.h
│       ├── seccomp.c
│       └── walredoproc.c
├── postgres.mk
├── pre-commit.py
├── proxy/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── auth/
│       │   ├── backend/
│       │   │   ├── classic.rs
│       │   │   ├── console_redirect.rs
│       │   │   ├── hacks.rs
│       │   │   ├── jwt.rs
│       │   │   ├── local.rs
│       │   │   └── mod.rs
│       │   ├── credentials.rs
│       │   ├── flow.rs
│       │   ├── mod.rs
│       │   └── password_hack.rs
│       ├── batch.rs
│       ├── bin/
│       │   ├── local_proxy.rs
│       │   ├── pg_sni_router.rs
│       │   └── proxy.rs
│       ├── binary/
│       │   ├── local_proxy.rs
│       │   ├── mod.rs
│       │   ├── pg_sni_router.rs
│       │   └── proxy.rs
│       ├── cache/
│       │   ├── common.rs
│       │   ├── mod.rs
│       │   ├── node_info.rs
│       │   └── project_info.rs
│       ├── cancellation.rs
│       ├── compute/
│       │   ├── mod.rs
│       │   └── tls.rs
│       ├── compute_ctl/
│       │   └── mod.rs
│       ├── config.rs
│       ├── console_redirect_proxy.rs
│       ├── context/
│       │   ├── mod.rs
│       │   └── parquet.rs
│       ├── control_plane/
│       │   ├── client/
│       │   │   ├── cplane_proxy_v1.rs
│       │   │   ├── mock.rs
│       │   │   └── mod.rs
│       │   ├── errors.rs
│       │   ├── messages.rs
│       │   ├── mgmt.rs
│       │   └── mod.rs
│       ├── error.rs
│       ├── ext.rs
│       ├── http/
│       │   ├── health_server.rs
│       │   └── mod.rs
│       ├── intern.rs
│       ├── jemalloc.rs
│       ├── lib.rs
│       ├── logging.rs
│       ├── metrics.rs
│       ├── parse.rs
│       ├── pglb/
│       │   ├── copy_bidirectional.rs
│       │   ├── handshake.rs
│       │   ├── inprocess.rs
│       │   ├── mod.rs
│       │   └── passthrough.rs
│       ├── pqproto.rs
│       ├── protocol2.rs
│       ├── proxy/
│       │   ├── connect_auth.rs
│       │   ├── connect_compute.rs
│       │   ├── mod.rs
│       │   ├── retry.rs
│       │   ├── tests/
│       │   │   ├── mitm.rs
│       │   │   └── mod.rs
│       │   └── wake_compute.rs
│       ├── rate_limiter/
│       │   ├── leaky_bucket.rs
│       │   ├── limit_algorithm/
│       │   │   └── aimd.rs
│       │   ├── limit_algorithm.rs
│       │   ├── limiter.rs
│       │   └── mod.rs
│       ├── redis/
│       │   ├── connection_with_credentials_provider.rs
│       │   ├── elasticache.rs
│       │   ├── keys.rs
│       │   ├── kv_ops.rs
│       │   ├── mod.rs
│       │   └── notifications.rs
│       ├── sasl/
│       │   ├── channel_binding.rs
│       │   ├── messages.rs
│       │   ├── mod.rs
│       │   └── stream.rs
│       ├── scram/
│       │   ├── cache.rs
│       │   ├── countmin.rs
│       │   ├── exchange.rs
│       │   ├── key.rs
│       │   ├── messages.rs
│       │   ├── mod.rs
│       │   ├── pbkdf2.rs
│       │   ├── secret.rs
│       │   ├── signature.rs
│       │   └── threadpool.rs
│       ├── serverless/
│       │   ├── backend.rs
│       │   ├── cancel_set.rs
│       │   ├── conn_pool.rs
│       │   ├── conn_pool_lib.rs
│       │   ├── error.rs
│       │   ├── http_conn_pool.rs
│       │   ├── http_util.rs
│       │   ├── json.rs
│       │   ├── local_conn_pool.rs
│       │   ├── mod.rs
│       │   ├── rest.rs
│       │   ├── sql_over_http.rs
│       │   └── websocket.rs
│       ├── signals.rs
│       ├── stream.rs
│       ├── tls/
│       │   ├── client_config.rs
│       │   ├── mod.rs
│       │   ├── postgres_rustls.rs
│       │   └── server_config.rs
│       ├── types.rs
│       ├── url.rs
│       ├── usage_metrics.rs
│       ├── util.rs
│       └── waiters.rs
├── pyproject.toml
├── pytest.ini
├── run_clippy.sh
├── rust-toolchain.toml
├── safekeeper/
│   ├── Cargo.toml
│   ├── benches/
│   │   ├── README.md
│   │   └── receive_wal.rs
│   ├── client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── lib.rs
│   │       └── mgmt_api.rs
│   ├── spec/
│   │   ├── .gitignore
│   │   ├── MCProposerAcceptorReconfig.tla
│   │   ├── MCProposerAcceptorStatic.tla
│   │   ├── ProposerAcceptorReconfig.tla
│   │   ├── ProposerAcceptorStatic.tla
│   │   ├── modelcheck.sh
│   │   ├── models/
│   │   │   ├── MCProposerAcceptorReconfig_p2_a2_t2_l2_c3.cfg
│   │   │   ├── MCProposerAcceptorReconfig_p2_a2_t2_l2_c5.cfg
│   │   │   ├── MCProposerAcceptorReconfig_p2_a3_t2_l2_c3.cfg
│   │   │   ├── MCProposerAcceptorReconfig_p2_a4_t2_l2_c3.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t2_l2.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t3_l2.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t3_l3.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a3_t4_l4.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a5_t2_l2.cfg
│   │   │   ├── MCProposerAcceptorStatic_p2_a5_t3_l3.cfg
│   │   │   └── MCProposerAcceptorStatic_p2_a5_t4_l3.cfg
│   │   ├── readme.md
│   │   ├── remove_interm_progress.awk
│   │   ├── remove_interm_progress.sh
│   │   └── tlc-results/
│   │       ├── MCProposerAcceptorReconfig.tla-MCProposerAcceptorReconfig_p2_a2_t2_l2_c3.cfg-2024-12-11--04-24-12.log
│   │       ├── MCProposerAcceptorReconfig.tla-MCProposerAcceptorReconfig_p2_a2_t2_l2_c5.cfg-2024-12-11--04-26-11.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t2_l2.cfg-2024-11-06--13-44-17.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t3_l2.cfg-2024-11-15--09-09-58.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t3_l3.cfg-2024-11-06--13-03-51.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t4_l4.cfg-2024-11-06--14-20-25.log
│   │       ├── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a3_t4_l4.cfg-2024-11-06--15-30-45.log
│   │       └── MCProposerAcceptorStatic.tla-MCProposerAcceptorStatic_p2_a5_t2_l2.cfg-2024-11-06--12-09-32.log
│   ├── src/
│   │   ├── auth.rs
│   │   ├── bin/
│   │   │   └── safekeeper.rs
│   │   ├── broker.rs
│   │   ├── control_file.rs
│   │   ├── control_file_upgrade.rs
│   │   ├── copy_timeline.rs
│   │   ├── debug_dump.rs
│   │   ├── hadron.rs
│   │   ├── handler.rs
│   │   ├── http/
│   │   │   ├── mod.rs
│   │   │   ├── openapi_spec.yaml
│   │   │   └── routes.rs
│   │   ├── lib.rs
│   │   ├── metrics.rs
│   │   ├── patch_control_file.rs
│   │   ├── pull_timeline.rs
│   │   ├── rate_limit.rs
│   │   ├── receive_wal.rs
│   │   ├── recovery.rs
│   │   ├── remove_wal.rs
│   │   ├── safekeeper.rs
│   │   ├── send_interpreted_wal.rs
│   │   ├── send_wal.rs
│   │   ├── state.rs
│   │   ├── test_utils.rs
│   │   ├── timeline.rs
│   │   ├── timeline_eviction.rs
│   │   ├── timeline_guard.rs
│   │   ├── timeline_manager.rs
│   │   ├── timelines_global_map.rs
│   │   ├── timelines_set.rs
│   │   ├── wal_backup.rs
│   │   ├── wal_backup_partial.rs
│   │   ├── wal_reader_stream.rs
│   │   ├── wal_service.rs
│   │   └── wal_storage.rs
│   └── tests/
│       ├── misc_test.rs
│       ├── random_test.rs
│       ├── simple_test.rs
│       └── walproposer_sim/
│           ├── block_storage.rs
│           ├── log.rs
│           ├── mod.rs
│           ├── safekeeper.rs
│           ├── safekeeper_disk.rs
│           ├── simulation.rs
│           ├── simulation_logs.rs
│           ├── walproposer_api.rs
│           └── walproposer_disk.rs
├── scripts/
│   ├── benchmark_durations.py
│   ├── check_allowed_errors.sh
│   ├── comment-test-report.js
│   ├── coverage
│   ├── download_basebackup.py
│   ├── force_layer_download.py
│   ├── generate_and_push_perf_report.sh
│   ├── ingest_perf_test_result.py
│   ├── ingest_regress_test_result-new-format.py
│   ├── ninstall.sh
│   ├── perf_report_template.html
│   ├── proxy_bench_results_ingest.py
│   ├── ps_ec2_setup_instance_store
│   ├── pysync
│   ├── pytest
│   ├── reformat
│   ├── sk_cleanup_tenants/
│   │   ├── readme.md
│   │   ├── remote.yaml
│   │   └── script.py
│   └── sk_collect_dumps/
│       ├── .gitignore
│       ├── ansible.cfg
│       ├── pyproject.toml
│       ├── readme.md
│       ├── remote.yaml
│       ├── ssh.cfg
│       └── upload.sh
├── storage_broker/
│   ├── Cargo.toml
│   ├── benches/
│   │   └── rps.rs
│   ├── build.rs
│   ├── proto/
│   │   ├── .gitignore
│   │   └── broker.proto
│   └── src/
│       ├── bin/
│       │   └── storage_broker.rs
│       ├── lib.rs
│       └── metrics.rs
├── storage_controller/
│   ├── Cargo.toml
│   ├── client/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── control_api.rs
│   │       └── lib.rs
│   ├── migrations/
│   │   ├── .keep
│   │   ├── 00000000000000_diesel_initial_setup/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-01-07-211257_create_tenant_shards/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-01-07-212945_create_nodes/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-02-29-094122_generations_null/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-03-18-184429_rename_policy/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-03-27-133204_tenant_policies/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-07-23-191537_create_metadata_health/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-07-26-140924_create_leader/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-23-102952_safekeepers/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-23-170149_tenant_id_index/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-27-184400_pageserver_az/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-08-28-150530_pageserver_az_not_null/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-09-05-104500_tenant_shard_preferred_az/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2024-12-12-212515_safekeepers_scheduling_policy/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-01-09-160454_safekeepers_remove_active/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-01-15-181207_safekeepers_disabled_to_pause/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-02-11-144848_pageserver_use_https/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-02-14-160526_safekeeper_timelines/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-02-28-141741_safekeeper_use_https/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-03-18-103700_timeline_imports/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-06-01-201442_add_lifecycle_to_nodes/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-06-17-082247_pageserver_grpc_addr/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-07-02-170751_safekeeper_default_no_pause/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   ├── 2025-07-08-114340_sk_set_notified_generation/
│   │   │   ├── down.sql
│   │   │   └── up.sql
│   │   └── 2025-07-17-000001_hadron_safekeepers/
│   │       ├── down.sql
│   │       └── up.sql
│   └── src/
│       ├── auth.rs
│       ├── background_node_operations.rs
│       ├── compute_hook.rs
│       ├── hadron_utils.rs
│       ├── heartbeater.rs
│       ├── http.rs
│       ├── id_lock_map.rs
│       ├── leadership.rs
│       ├── lib.rs
│       ├── main.rs
│       ├── metrics.rs
│       ├── node.rs
│       ├── operation_utils.rs
│       ├── pageserver_client.rs
│       ├── peer_client.rs
│       ├── persistence/
│       │   └── split_state.rs
│       ├── persistence.rs
│       ├── reconciler.rs
│       ├── safekeeper.rs
│       ├── safekeeper_client.rs
│       ├── scheduler.rs
│       ├── schema.rs
│       ├── service/
│       │   ├── chaos_injector.rs
│       │   ├── feature_flag.rs
│       │   ├── safekeeper_reconciler.rs
│       │   ├── safekeeper_service.rs
│       │   └── tenant_shard_iterator.rs
│       ├── service.rs
│       ├── tenant_shard.rs
│       └── timeline_import.rs
├── storage_scrubber/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── checks.rs
│       ├── cloud_admin_api.rs
│       ├── find_large_objects.rs
│       ├── garbage.rs
│       ├── lib.rs
│       ├── main.rs
│       ├── metadata_stream.rs
│       ├── pageserver_physical_gc.rs
│       ├── scan_pageserver_metadata.rs
│       ├── scan_safekeeper_metadata.rs
│       └── tenant_snapshot.rs
├── test_runner/
│   ├── README.md
│   ├── bin/
│   │   └── neon_local_create_deep_l0_stack.py
│   ├── cloud_regress/
│   │   ├── README.md
│   │   └── test_cloud_regress.py
│   ├── conftest.py
│   ├── fixtures/
│   │   ├── __init__.py
│   │   ├── auth_tokens.py
│   │   ├── benchmark_fixture.py
│   │   ├── common_types.py
│   │   ├── compare_fixtures.py
│   │   ├── compute_migrations.py
│   │   ├── compute_reconfigure.py
│   │   ├── endpoint/
│   │   │   ├── __init__.py
│   │   │   └── http.py
│   │   ├── fast_import.py
│   │   ├── h2server.py
│   │   ├── httpserver.py
│   │   ├── log_helper.py
│   │   ├── metrics.py
│   │   ├── neon_api.py
│   │   ├── neon_cli.py
│   │   ├── neon_fixtures.py
│   │   ├── overlayfs.py
│   │   ├── pageserver/
│   │   │   ├── __init__.py
│   │   │   ├── allowed_errors.py
│   │   │   ├── common_types.py
│   │   │   ├── http.py
│   │   │   ├── makelayers/
│   │   │   │   ├── __init__.py
│   │   │   │   └── l0stack.py
│   │   │   ├── many_tenants.py
│   │   │   ├── remote_storage.py
│   │   │   └── utils.py
│   │   ├── parametrize.py
│   │   ├── paths.py
│   │   ├── pg_config.py
│   │   ├── pg_stats.py
│   │   ├── pg_version.py
│   │   ├── port_distributor.py
│   │   ├── remote_storage.py
│   │   ├── reruns.py
│   │   ├── safekeeper/
│   │   │   ├── __init__.py
│   │   │   ├── http.py
│   │   │   └── utils.py
│   │   ├── safekeeper_utils.py
│   │   ├── slow.py
│   │   ├── storage_controller_proxy.py
│   │   ├── utils.py
│   │   └── workload.py
│   ├── logical_repl/
│   │   ├── README.md
│   │   ├── clickhouse/
│   │   │   └── docker-compose.yml
│   │   ├── debezium/
│   │   │   └── docker-compose.yml
│   │   ├── test_clickhouse.py
│   │   └── test_debezium.py
│   ├── performance/
│   │   ├── README.md
│   │   ├── __init__.py
│   │   ├── benchbase_tpc_c_helpers/
│   │   │   ├── generate_diagrams.py
│   │   │   ├── generate_workload_size.py
│   │   │   └── upload_results_to_perf_test_results.py
│   │   ├── large_synthetic_oltp/
│   │   │   ├── IUD_one_transaction.sql
│   │   │   ├── grow_action_blocks.sql
│   │   │   ├── grow_action_kwargs.sql
│   │   │   ├── grow_device_fingerprint_event.sql
│   │   │   ├── grow_edges.sql
│   │   │   ├── grow_hotel_rate_mapping.sql
│   │   │   ├── grow_ocr_pipeline_results_version.sql
│   │   │   ├── grow_priceline_raw_response.sql
│   │   │   ├── grow_relabled_transactions.sql
│   │   │   ├── grow_state_values.sql
│   │   │   ├── grow_values.sql
│   │   │   ├── grow_vertices.sql
│   │   │   ├── insert_webhooks.sql
│   │   │   ├── select_any_webhook_with_skew.sql
│   │   │   ├── select_prefetch_webhook.sql
│   │   │   ├── select_recent_webhook.sql
│   │   │   ├── update_accounting_coding_body_tracking_category_selection.sql
│   │   │   ├── update_action_blocks.sql
│   │   │   ├── update_action_kwargs.sql
│   │   │   ├── update_denormalized_approval_workflow.sql
│   │   │   ├── update_device_fingerprint_event.sql
│   │   │   ├── update_edges.sql
│   │   │   ├── update_heron_transaction_enriched_log.sql
│   │   │   ├── update_heron_transaction_enrichment_requests.sql
│   │   │   ├── update_hotel_rate_mapping.sql
│   │   │   ├── update_incoming_webhooks.sql
│   │   │   ├── update_manual_transaction.sql
│   │   │   ├── update_ml_receipt_matching_log.sql
│   │   │   ├── update_ocr_pipeine_results_version.sql
│   │   │   ├── update_orc_pipeline_step_results.sql
│   │   │   ├── update_orc_pipeline_step_results_version.sql
│   │   │   ├── update_priceline_raw_response.sql
│   │   │   ├── update_quickbooks_transactions.sql
│   │   │   ├── update_raw_finicity_transaction.sql
│   │   │   ├── update_relabeled_transactions.sql
│   │   │   ├── update_state_values.sql
│   │   │   ├── update_stripe_authorization_event_log.sql
│   │   │   ├── update_transaction.sql
│   │   │   ├── update_values.sql
│   │   │   └── update_vertices.sql
│   │   ├── many_relations/
│   │   │   └── create_many_relations.sql
│   │   ├── out_dir_to_csv.py
│   │   ├── pageserver/
│   │   │   ├── README.md
│   │   │   ├── __init__.py
│   │   │   ├── interactive/
│   │   │   │   ├── __init__.py
│   │   │   │   └── test_many_small_tenants.py
│   │   │   ├── pagebench/
│   │   │   │   ├── __init__.py
│   │   │   │   ├── test_large_slru_basebackup.py
│   │   │   │   ├── test_ondemand_download_churn.py
│   │   │   │   └── test_pageserver_max_throughput_getpage_at_latest_lsn.py
│   │   │   ├── test_page_service_batching.py
│   │   │   └── util.py
│   │   ├── pgvector/
│   │   │   ├── HNSW_build.sql
│   │   │   ├── IVFFLAT_build.sql
│   │   │   ├── README.md
│   │   │   ├── halfvec_build.sql
│   │   │   ├── loaddata.py
│   │   │   ├── pgbench_custom_script_pgvector_halfvec_queries.sql
│   │   │   └── pgbench_custom_script_pgvector_hsnw_queries.sql
│   │   ├── test_branch_creation.py
│   │   ├── test_branching.py
│   │   ├── test_bulk_insert.py
│   │   ├── test_bulk_tenant_create.py
│   │   ├── test_bulk_update.py
│   │   ├── test_compaction.py
│   │   ├── test_compare_pg_stats.py
│   │   ├── test_compute_ctl_api.py
│   │   ├── test_compute_startup.py
│   │   ├── test_copy.py
│   │   ├── test_cumulative_statistics_persistence.py
│   │   ├── test_dup_key.py
│   │   ├── test_gc_feedback.py
│   │   ├── test_gist_build.py
│   │   ├── test_hot_page.py
│   │   ├── test_hot_table.py
│   │   ├── test_ingest_insert_bulk.py
│   │   ├── test_ingest_logical_message.py
│   │   ├── test_latency.py
│   │   ├── test_layer_map.py
│   │   ├── test_lfc_prewarm.py
│   │   ├── test_logical_replication.py
│   │   ├── test_parallel_copy.py
│   │   ├── test_parallel_copy_to.py
│   │   ├── test_perf_ingest_using_pgcopydb.py
│   │   ├── test_perf_many_relations.py
│   │   ├── test_perf_olap.py
│   │   ├── test_perf_oltp_large_tenant.py
│   │   ├── test_perf_pgbench.py
│   │   ├── test_perf_pgvector_queries.py
│   │   ├── test_physical_replication.py
│   │   ├── test_random_writes.py
│   │   ├── test_seqscans.py
│   │   ├── test_sharded_ingest.py
│   │   ├── test_sharding_autosplit.py
│   │   ├── test_storage_controller_scale.py
│   │   ├── test_wal_backpressure.py
│   │   ├── test_write_amplification.py
│   │   └── tpc-h/
│   │       ├── create-indexes.sql
│   │       ├── create-schema.sql
│   │       └── queries/
│   │           ├── 1.sql
│   │           ├── 10.sql
│   │           ├── 11.sql
│   │           ├── 12.sql
│   │           ├── 13.sql
│   │           ├── 14.sql
│   │           ├── 15.sql
│   │           ├── 16.sql
│   │           ├── 17.sql
│   │           ├── 18.sql
│   │           ├── 19.sql
│   │           ├── 2.sql
│   │           ├── 20.sql
│   │           ├── 21.sql
│   │           ├── 22.sql
│   │           ├── 3.sql
│   │           ├── 4.sql
│   │           ├── 5.sql
│   │           ├── 6.sql
│   │           ├── 7.sql
│   │           ├── 8.sql
│   │           └── 9.sql
│   ├── pg_clients/
│   │   ├── README.md
│   │   ├── csharp/
│   │   │   └── npgsql/
│   │   │       ├── .dockerignore
│   │   │       ├── .gitignore
│   │   │       ├── Dockerfile
│   │   │       ├── Program.cs
│   │   │       └── csharp-npgsql.csproj
│   │   ├── java/
│   │   │   └── jdbc/
│   │   │       ├── Dockerfile
│   │   │       └── Example.java
│   │   ├── python/
│   │   │   ├── asyncpg/
│   │   │   │   ├── Dockerfile
│   │   │   │   ├── asyncpg_example.py
│   │   │   │   └── requirements.txt
│   │   │   └── pg8000/
│   │   │       ├── Dockerfile
│   │   │       ├── pg8000_example.py
│   │   │       └── requirements.txt
│   │   ├── rust/
│   │   │   └── tokio-postgres/
│   │   │       ├── .dockerignore
│   │   │       ├── .gitignore
│   │   │       ├── Cargo.toml
│   │   │       ├── Dockerfile
│   │   │       └── src/
│   │   │           └── main.rs
│   │   ├── swift/
│   │   │   ├── PostgresClientKitExample/
│   │   │   │   ├── .dockerignore
│   │   │   │   ├── .gitignore
│   │   │   │   ├── Dockerfile
│   │   │   │   ├── Package.resolved
│   │   │   │   ├── Package.swift
│   │   │   │   └── Sources/
│   │   │   │       └── PostgresClientKitExample/
│   │   │   │           └── main.swift
│   │   │   └── PostgresNIOExample/
│   │   │       ├── .dockerignore
│   │   │       ├── .gitignore
│   │   │       ├── Dockerfile
│   │   │       ├── Package.resolved
│   │   │       ├── Package.swift
│   │   │       └── Sources/
│   │   │           └── PostgresNIOExample/
│   │   │               └── main.swift
│   │   ├── test_pg_clients.py
│   │   └── typescript/
│   │       ├── postgresql-client/
│   │       │   ├── .dockerignore
│   │       │   ├── .gitignore
│   │       │   ├── Dockerfile
│   │       │   ├── index.js
│   │       │   └── package.json
│   │       └── serverless-driver/
│   │           ├── .dockerignore
│   │           ├── .gitignore
│   │           ├── Dockerfile
│   │           ├── index.js
│   │           └── package.json
│   ├── random_ops/
│   │   ├── README.md
│   │   └── test_random_ops.py
│   ├── regress/
│   │   ├── data/
│   │   │   ├── test_event_trigger_extension/
│   │   │   │   ├── test_event_trigger_extension--1.0.sql
│   │   │   │   └── test_event_trigger_extension.control
│   │   │   ├── test_remote_extensions/
│   │   │   │   ├── test_extension_sql_only/
│   │   │   │   │   ├── sql/
│   │   │   │   │   │   ├── test_extension_sql_only--1.0--1.1.sql
│   │   │   │   │   │   └── test_extension_sql_only--1.0.sql
│   │   │   │   │   └── test_extension_sql_only.control
│   │   │   │   └── test_extension_with_lib/
│   │   │   │       ├── sql/
│   │   │   │       │   ├── test_extension_with_lib--1.0--1.1.sql
│   │   │   │       │   └── test_extension_with_lib--1.0.sql
│   │   │   │       ├── src/
│   │   │   │       │   └── test_extension_with_lib.c
│   │   │   │       └── test_extension_with_lib.control
│   │   │   └── test_signed_char.out
│   │   ├── test_ancestor_branch.py
│   │   ├── test_attach_tenant_config.py
│   │   ├── test_auth.py
│   │   ├── test_auth_broker.py
│   │   ├── test_backpressure.py
│   │   ├── test_bad_connection.py
│   │   ├── test_basebackup.py
│   │   ├── test_basebackup_error.py
│   │   ├── test_branch_and_gc.py
│   │   ├── test_branch_behind.py
│   │   ├── test_branching.py
│   │   ├── test_broken_timeline.py
│   │   ├── test_build_info_metric.py
│   │   ├── test_change_pageserver.py
│   │   ├── test_clog_truncate.py
│   │   ├── test_close_fds.py
│   │   ├── test_combocid.py
│   │   ├── test_communicator_metrics_exporter.py
│   │   ├── test_compaction.py
│   │   ├── test_compatibility.py
│   │   ├── test_compute_catalog.py
│   │   ├── test_compute_http.py
│   │   ├── test_compute_locales.py
│   │   ├── test_compute_metrics.py
│   │   ├── test_compute_migrations.py
│   │   ├── test_compute_monitor.py
│   │   ├── test_compute_reconfigure.py
│   │   ├── test_compute_termination.py
│   │   ├── test_config.py
│   │   ├── test_crafted_wal_end.py
│   │   ├── test_createdropdb.py
│   │   ├── test_createuser.py
│   │   ├── test_ddl_forwarding.py
│   │   ├── test_disk_usage_eviction.py
│   │   ├── test_download_extensions.py
│   │   ├── test_endpoint_crash.py
│   │   ├── test_endpoint_storage.py
│   │   ├── test_event_trigger_extension.py
│   │   ├── test_explain_with_lfc_stats.py
│   │   ├── test_extensions.py
│   │   ├── test_feature_flag.py
│   │   ├── test_fsm_truncate.py
│   │   ├── test_fullbackup.py
│   │   ├── test_gc_aggressive.py
│   │   ├── test_gin_redo.py
│   │   ├── test_gist.py
│   │   ├── test_hadron_ps_connectivity_metrics.py
│   │   ├── test_hcc_handling_ps_data_loss.py
│   │   ├── test_hot_standby.py
│   │   ├── test_import.py
│   │   ├── test_import_pgdata.py
│   │   ├── test_ingestion_layer_size.py
│   │   ├── test_large_schema.py
│   │   ├── test_layer_bloating.py
│   │   ├── test_layer_eviction.py
│   │   ├── test_layer_writers_fail.py
│   │   ├── test_layers_from_future.py
│   │   ├── test_lfc_prefetch.py
│   │   ├── test_lfc_prewarm.py
│   │   ├── test_lfc_resize.py
│   │   ├── test_lfc_working_set_approximation.py
│   │   ├── test_local_file_cache.py
│   │   ├── test_logging.py
│   │   ├── test_logical_replication.py
│   │   ├── test_lsn_mapping.py
│   │   ├── test_multixact.py
│   │   ├── test_nbtree_pagesplit_cycleid.py
│   │   ├── test_neon_cli.py
│   │   ├── test_neon_extension.py
│   │   ├── test_neon_local_cli.py
│   │   ├── test_neon_superuser.py
│   │   ├── test_next_xid.py
│   │   ├── test_normal_work.py
│   │   ├── test_oid_overflow.py
│   │   ├── test_old_request_lsn.py
│   │   ├── test_ondemand_download.py
│   │   ├── test_ondemand_slru_download.py
│   │   ├── test_ondemand_wal_download.py
│   │   ├── test_page_service_batching_regressions.py
│   │   ├── test_pageserver_api.py
│   │   ├── test_pageserver_catchup.py
│   │   ├── test_pageserver_config.py
│   │   ├── test_pageserver_crash_consistency.py
│   │   ├── test_pageserver_generations.py
│   │   ├── test_pageserver_getpage_throttle.py
│   │   ├── test_pageserver_layer_rolling.py
│   │   ├── test_pageserver_metric_collection.py
│   │   ├── test_pageserver_reconnect.py
│   │   ├── test_pageserver_restart.py
│   │   ├── test_pageserver_restarts_under_workload.py
│   │   ├── test_pageserver_secondary.py
│   │   ├── test_pg_query_cancellation.py
│   │   ├── test_pg_regress.py
│   │   ├── test_pg_waldump.py
│   │   ├── test_pgstat.py
│   │   ├── test_physical_and_logical_replicaiton.py
│   │   ├── test_physical_replication.py
│   │   ├── test_pitr_gc.py
│   │   ├── test_postgres_version.py
│   │   ├── test_prefetch_buffer_resize.py
│   │   ├── test_proxy.py
│   │   ├── test_proxy_allowed_ips.py
│   │   ├── test_proxy_metric_collection.py
│   │   ├── test_proxy_websockets.py
│   │   ├── test_read_validation.py
│   │   ├── test_readonly_node.py
│   │   ├── test_recovery.py
│   │   ├── test_relations.py
│   │   ├── test_remote_storage.py
│   │   ├── test_replica_promotes.py
│   │   ├── test_replica_start.py
│   │   ├── test_rest_broker.py
│   │   ├── test_role_grants.py
│   │   ├── test_s3_restore.py
│   │   ├── test_safekeeper_deletion.py
│   │   ├── test_safekeeper_migration.py
│   │   ├── test_setup.py
│   │   ├── test_sharding.py
│   │   ├── test_signed_char.py
│   │   ├── test_sni_router.py
│   │   ├── test_ssl.py
│   │   ├── test_storage_controller.py
│   │   ├── test_storage_scrubber.py
│   │   ├── test_subscriber_branching.py
│   │   ├── test_subscriber_restart.py
│   │   ├── test_subxacts.py
│   │   ├── test_tenant_conf.py
│   │   ├── test_tenant_delete.py
│   │   ├── test_tenant_detach.py
│   │   ├── test_tenant_relocation.py
│   │   ├── test_tenant_size.py
│   │   ├── test_tenant_tasks.py
│   │   ├── test_tenants.py
│   │   ├── test_tenants_with_remote_storage.py
│   │   ├── test_threshold_based_eviction.py
│   │   ├── test_timeline_archive.py
│   │   ├── test_timeline_delete.py
│   │   ├── test_timeline_detach_ancestor.py
│   │   ├── test_timeline_gc_blocking.py
│   │   ├── test_timeline_size.py
│   │   ├── test_truncate.py
│   │   ├── test_twophase.py
│   │   ├── test_unlogged.py
│   │   ├── test_unstable_extensions.py
│   │   ├── test_vm_bits.py
│   │   ├── test_vm_truncate.py
│   │   ├── test_wal_acceptor.py
│   │   ├── test_wal_acceptor_async.py
│   │   ├── test_wal_receiver.py
│   │   ├── test_wal_restore.py
│   │   └── test_walredo_not_left_behind_on_detach.py
│   ├── sql_regress/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── expected/
│   │   │   ├── .gitignore
│   │   │   ├── neon-cid.out
│   │   │   ├── neon-clog.out
│   │   │   ├── neon-event-triggers.out
│   │   │   ├── neon-rel-truncate.out
│   │   │   ├── neon-spgist.out
│   │   │   ├── neon-subxacts.out
│   │   │   ├── neon-test-utils.out
│   │   │   └── neon-vacuum-full.out
│   │   ├── parallel_schedule
│   │   └── sql/
│   │       ├── .gitignore
│   │       ├── neon-cid.sql
│   │       ├── neon-clog.sql
│   │       ├── neon-event-triggers.sql
│   │       ├── neon-rel-truncate.sql
│   │       ├── neon-spgist.sql
│   │       ├── neon-subxacts.sql
│   │       ├── neon-test-utils.sql
│   │       └── neon-vacuum-full.sql
│   ├── stubs/
│   │   └── h2/
│   │       ├── README.md
│   │       ├── __init__.pyi
│   │       ├── config.pyi
│   │       ├── connection.pyi
│   │       ├── errors.pyi
│   │       ├── events.pyi
│   │       ├── exceptions.pyi
│   │       ├── frame_buffer.pyi
│   │       ├── settings.pyi
│   │       ├── stream.pyi
│   │       ├── utilities.pyi
│   │       └── windows.pyi
│   ├── test_broken.py
│   └── websocket_tunnel.py
├── vendor/
│   └── revisions.json
└── workspace_hack/
    ├── .gitattributes
    ├── Cargo.toml
    ├── build.rs
    └── src/
        └── lib.rs
Download .txt
Showing preview only (1,001K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (12141 symbols across 620 files)

FILE: compute_tools/src/bin/compute_ctl.rs
  type Cli (line 65) | struct Cli {
    method parse_remote_ext_base_url (line 162) | fn parse_remote_ext_base_url(value: &str) -> Result<Url> {
    method parse_privileged_role_name (line 180) | fn parse_privileged_role_name(value: &str) -> Result<String> {
  function get_external_http_port (line 197) | fn get_external_http_port(cli: &Cli) -> u16 {
  function get_internal_http_port (line 203) | fn get_internal_http_port(cli: &Cli) -> u16 {
  function main (line 213) | fn main() -> Result<()> {
  function init (line 289) | fn init(
  function get_config (line 310) | fn get_config(cli: &Cli) -> Result<ComputeConfig> {
  function deinit_and_exit (line 332) | fn deinit_and_exit(tracing_provider: Option<tracing_utils::Provider>, ex...
  function handle_exit_signal (line 362) | fn handle_exit_signal(sig: i32, dev_mode: bool) {
  function verify_cli (line 376) | fn verify_cli() {
  function verify_remote_ext_base_url (line 381) | fn verify_remote_ext_base_url() {
  function verify_privileged_role_name (line 420) | fn verify_privileged_role_name() {

FILE: compute_tools/src/bin/fast_import.rs
  constant PG_WAIT_TIMEOUT (line 45) | const PG_WAIT_TIMEOUT: std::time::Duration = std::time::Duration::from_s...
  constant PG_WAIT_RETRY_INTERVAL (line 46) | const PG_WAIT_RETRY_INTERVAL: std::time::Duration = std::time::Duration:...
  type Command (line 49) | enum Command {
    method as_str (line 89) | fn as_str(&self) -> &'static str {
  type Args (line 98) | struct Args {
  type Spec (line 114) | struct Spec {
  type EncryptionSecret (line 123) | enum EncryptionSecret {
  constant DEFAULT_LOCALE (line 129) | const DEFAULT_LOCALE: &str = if cfg!(target_os = "macos") {
  function decode_connstring (line 135) | async fn decode_connstring(
  type PostgresProcess (line 158) | struct PostgresProcess {
    method new (line 167) | fn new(pgdata_dir: Utf8PathBuf, pg_bin_dir: Utf8PathBuf, pg_lib_dir: U...
    method prepare (line 177) | async fn prepare(&self, initdb_user: &str) -> Result<(), anyhow::Error> {
    method start (line 196) | async fn start(
    method shutdown (line 258) | async fn shutdown(&mut self) -> Result<(), anyhow::Error> {
  function wait_until_ready (line 273) | async fn wait_until_ready(connstring: String, create_dbname: String) {
  function run_dump_restore (line 330) | async fn run_dump_restore(
  function cmd_pgdata (line 448) | async fn cmd_pgdata(
  function cmd_dumprestore (line 543) | async fn cmd_dumprestore(
  function main (line 600) | pub(crate) async fn main() -> anyhow::Result<()> {

FILE: compute_tools/src/bin/fast_import/aws_s3_sync.rs
  constant MAX_PARALLEL_UPLOADS (line 8) | const MAX_PARALLEL_UPLOADS: usize = 10;
  function upload_dir_recursive (line 11) | pub(crate) async fn upload_dir_recursive(
  function upload_file (line 83) | pub(crate) async fn upload_file(

FILE: compute_tools/src/bin/fast_import/child_stdio_to_log.rs
  function relay_process_output (line 13) | pub(crate) async fn relay_process_output(stdout: Option<ChildStdout>, st...

FILE: compute_tools/src/bin/fast_import/s3_uri.rs
  type S3Uri (line 7) | pub struct S3Uri {
    method append (line 40) | pub fn append(&self, suffix: &str) -> Self {
    method fmt (line 49) | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
    type Value (line 55) | type Value = Self;
    method parse_ref (line 57) | fn parse_ref(
  type Err (line 13) | type Err = anyhow::Error;
  method from_str (line 16) | fn from_str(uri: &str) -> Result<Self> {

FILE: compute_tools/src/catalog.rs
  function get_dbs_and_roles (line 19) | pub async fn get_dbs_and_roles(compute: &Arc<ComputeNode>) -> anyhow::Re...
  type SchemaDumpError (line 40) | pub enum SchemaDumpError {
  function get_database_schema (line 57) | pub async fn get_database_schema(

FILE: compute_tools/src/checker.rs
  function check_writability (line 10) | pub async fn check_writability(compute: &ComputeNode) -> Result<()> {

FILE: compute_tools/src/communicator_socket_client.rs
  constant NEON_COMMUNICATOR_SOCKET_NAME (line 14) | const NEON_COMMUNICATOR_SOCKET_NAME: &str = "neon-communicator.socket";
  function connect_communicator_socket (line 18) | pub async fn connect_communicator_socket<B>(pgdata: &Path) -> anyhow::Re...

FILE: compute_tools/src/compute.rs
  constant BUILD_TAG_DEFAULT (line 71) | const BUILD_TAG_DEFAULT: &str = "latest";
  constant DEFAULT_INSTALLED_EXTENSIONS_COLLECTION_INTERVAL (line 80) | const DEFAULT_INSTALLED_EXTENSIONS_COLLECTION_INTERVAL: u64 = 3600;
  type ComputeNodeParams (line 85) | pub struct ComputeNodeParams {
  type TaskHandle (line 136) | type TaskHandle = Mutex<Option<JoinHandle<()>>>;
  type ComputeNode (line 139) | pub struct ComputeNode {
    method new (line 570) | pub fn new(params: ComputeNodeParams, config: ComputeConfig) -> Result...
    method run (line 627) | pub fn run(self) -> Result<Option<i32>> {
    method wait_spec (line 752) | pub fn wait_spec(&self) -> Result<ParsedSpec> {
    method start_compute (line 793) | fn start_compute(self: &Arc<Self>, pg_handle: &mut Option<PostgresHand...
    method download_preload_extensions (line 1057) | async fn download_preload_extensions(&self, spec: &ComputeSpec) -> Res...
    method start_vm_monitor (line 1091) | fn start_vm_monitor(&self, disable_lfc_resizing: bool) -> StartVmMonit...
    method cleanup_after_postgres_exit (line 1128) | fn cleanup_after_postgres_exit(&self) -> Result<bool> {
    method has_feature (line 1168) | pub fn has_feature(&self, feature: ComputeFeature) -> bool {
    method set_status (line 1178) | pub fn set_status(&self, status: ComputeStatus) {
    method set_failed_status (line 1183) | pub fn set_failed_status(&self, err: anyhow::Error) {
    method get_status (line 1188) | pub fn get_status(&self) -> ComputeStatus {
    method get_timeline_id (line 1192) | pub fn get_timeline_id(&self) -> Option<TimelineId> {
    method create_pgdata (line 1202) | fn create_pgdata(&self) -> Result<()> {
    method try_get_basebackup (line 1223) | fn try_get_basebackup(&self, compute_state: &ComputeState, lsn: Lsn) -...
    method fix_zenith_signal_neon_signal (line 1246) | fn fix_zenith_signal_neon_signal(&self) -> Result<()> {
    method try_get_basebackup_grpc (line 1266) | fn try_get_basebackup_grpc(&self, spec: &ParsedSpec, lsn: Lsn) -> Resu...
    method try_get_basebackup_libpq (line 1311) | fn try_get_basebackup_libpq(&self, spec: &ParsedSpec, lsn: Lsn) -> Res...
    method get_basebackup (line 1382) | pub fn get_basebackup(&self, compute_state: &ComputeState, lsn: Lsn) -...
    method check_safekeepers_synced_async (line 1413) | pub async fn check_safekeepers_synced_async(
    method check_safekeepers_synced (line 1489) | pub fn check_safekeepers_synced(&self, compute_state: &ComputeState) -...
    method sync_safekeepers (line 1507) | pub fn sync_safekeepers(&self, storage_auth_token: Option<String>) -> ...
    method sync_safekeepers_with_retries (line 1563) | fn sync_safekeepers_with_retries(&self, storage_auth_token: Option<Str...
    method prepare_pgdata (line 1601) | pub fn prepare_pgdata(&self, compute_state: &ComputeState) -> Result<(...
    method prewarm_postgres_vm_memory (line 1728) | pub fn prewarm_postgres_vm_memory(&self) -> Result<()> {
    method start_postgres (line 1789) | pub fn start_postgres(&self, storage_auth_token: Option<String>) -> Re...
    method wait_postgres (line 1841) | fn wait_postgres(&self, mut pg_handle: PostgresHandle) -> std::process...
    method post_apply_config (line 1862) | pub fn post_apply_config(&self) -> Result<()> {
    method get_conn_conf (line 1886) | pub fn get_conn_conf(&self, application_name: Option<&str>) -> postgre...
    method get_tokio_conn_conf (line 1894) | pub fn get_tokio_conn_conf(&self, application_name: Option<&str>) -> t...
    method get_maintenance_client (line 1902) | pub async fn get_maintenance_client(
    method apply_config (line 1972) | pub fn apply_config(&self, compute_state: &ComputeState) -> Result<()> {
    method signal_refresh_configuration (line 2047) | pub async fn signal_refresh_configuration(&self) -> Result<()> {
    method pg_reload_conf (line 2074) | fn pg_reload_conf(&self) -> Result<()> {
    method reconfigure (line 2089) | pub fn reconfigure(&self) -> Result<()> {
    method configure_as_primary (line 2179) | pub fn configure_as_primary(&self, compute_state: &ComputeState) -> Re...
    method watch_cert_for_changes (line 2212) | pub async fn watch_cert_for_changes(self: Arc<Self>) {
    method tls_config (line 2265) | pub fn tls_config(&self, spec: &ComputeSpec) -> &Option<TlsConfig> {
    method update_last_active (line 2274) | pub fn update_last_active(&self, last_active: Option<DateTime<Utc>>) {
    method check_for_core_dumps (line 2296) | pub fn check_for_core_dumps(&self) -> Result<()> {
    method collect_insights (line 2370) | pub async fn collect_insights(&self) -> String {
    method download_extension (line 2410) | pub async fn download_extension(
    method set_role_grants (line 2495) | pub async fn set_role_grants(
    method install_extension (line 2552) | pub async fn install_extension(
    method prepare_preload_libraries (line 2602) | pub async fn prepare_preload_libraries(
    method wait_timeout_while_pageserver_connstr_unchanged (line 2693) | pub fn wait_timeout_while_pageserver_connstr_unchanged(&self, duration...
    method spawn_extension_stats_task (line 2719) | pub fn spawn_extension_stats_task(&self) {
    method terminate_extension_stats_task (line 2755) | fn terminate_extension_stats_task(&self) {
    method spawn_lfc_offload_task (line 2761) | pub fn spawn_lfc_offload_task(self: &Arc<Self>, interval: Duration) {
    method terminate_lfc_offload_task (line 2794) | fn terminate_lfc_offload_task(&self) {
    method update_installed_extensions_collection_interval (line 2800) | fn update_installed_extensions_collection_interval(&self, spec: &Compu...
    method set_spec (line 2819) | pub fn set_spec(params: &ComputeNodeParams, state: &mut ComputeState, ...
    method update_attached_metric (line 2825) | pub fn update_attached_metric(params: &ComputeNodeParams, state: &mut ...
  type RemoteExtensionMetrics (line 166) | pub struct RemoteExtensionMetrics {
  type ComputeState (line 173) | pub struct ComputeState {
    method new (line 211) | pub fn new() -> Self {
    method set_status (line 229) | pub fn set_status(&mut self, status: ComputeStatus, state_changed: &Co...
    method set_failed_status (line 241) | pub fn set_failed_status(&mut self, err: anyhow::Error, state_changed:...
  method default (line 248) | fn default() -> Self {
  type ParsedSpec (line 254) | pub struct ParsedSpec {
    method validate (line 267) | pub fn validate(&self) -> Result<(), String> {
    type Error (line 306) | type Error = anyhow::Error;
    method try_from (line 307) | fn try_from(spec: ComputeSpec) -> Result<Self, anyhow::Error> {
  function maybe_cgexec (line 412) | fn maybe_cgexec(cmd: &str) -> Command {
  type PostgresHandle (line 426) | struct PostgresHandle {
    method pid (line 433) | fn pid(&self) -> Pid {
  type StartVmMonitorResult (line 438) | struct StartVmMonitorResult {
  function create_databricks_roles (line 449) | pub(crate) fn create_databricks_roles() -> Vec<String> {
  type DatabricksEnvVars (line 506) | pub struct DatabricksEnvVars {
    method new (line 518) | pub fn new(
    constant DATABRICKS_ENDPOINT_ID_ENVVAR (line 547) | const DATABRICKS_ENDPOINT_ID_ENVVAR: &'static str = "DATABRICKS_ENDPOI...
    constant DATABRICKS_WORKSPACE_HOST_ENVVAR (line 548) | const DATABRICKS_WORKSPACE_HOST_ENVVAR: &'static str = "DATABRICKS_WOR...
    method to_env_var_list (line 551) | pub fn to_env_var_list(self) -> Vec<(String, String)> {
  function installed_extensions (line 2846) | pub async fn installed_extensions(conf: tokio_postgres::Config) -> Resul...
  function forward_termination_signal (line 2860) | pub fn forward_termination_signal(dev_mode: bool) {
  type JoinSetExt (line 2934) | trait JoinSetExt<T> {
    method spawn_blocking_child (line 2935) | fn spawn_blocking_child<F>(&mut self, f: F) -> tokio::task::AbortHandle
  function spawn_blocking_child (line 2942) | fn spawn_blocking_child<F>(&mut self, f: F) -> tokio::task::AbortHandle
  function duplicate_safekeeper_connstring (line 2962) | fn duplicate_safekeeper_connstring() {

FILE: compute_tools/src/compute_prewarm.rs
  type EndpointStoragePair (line 16) | struct EndpointStoragePair {
    method from_spec_and_endpoint (line 25) | fn from_spec_and_endpoint(
  constant KEY (line 21) | const KEY: &str = "lfc_state";
  method lfc_prewarm_state (line 49) | pub async fn lfc_prewarm_state(&self) -> LfcPrewarmState {
  method lfc_offload_state (line 53) | pub fn lfc_offload_state(&self) -> LfcOffloadState {
  method prewarm_lfc (line 59) | pub fn prewarm_lfc(self: &Arc<Self>, from_endpoint: Option<String>) -> b...
  method endpoint_storage_pair (line 94) | fn endpoint_storage_pair(&self, from_endpoint: Option<String>) -> Result...
  method prewarm_impl (line 100) | async fn prewarm_impl(
  method offload_lfc (line 188) | pub fn offload_lfc(self: &Arc<Self>) -> bool {
  method offload_lfc_async (line 203) | pub async fn offload_lfc_async(self: &Arc<Self>) {
  method offload_lfc_with_state_update (line 216) | async fn offload_lfc_with_state_update(&self) {
  method offload_lfc_impl (line 230) | async fn offload_lfc_impl(&self) -> Result<LfcOffloadState> {
  method cancel_prewarm (line 280) | pub fn cancel_prewarm(self: &Arc<Self>) {

FILE: compute_tools/src/compute_promote.rs
  method promote (line 12) | pub async fn promote(self: &std::sync::Arc<Self>, cfg: PromoteConfig) ->...
  method promote_impl (line 41) | async fn promote_impl(&self, cfg: PromoteConfig) -> anyhow::Result<Promo...

FILE: compute_tools/src/config.rs
  function line_in_file (line 25) | pub fn line_in_file(path: &Path, line: &str) -> Result<bool> {
  function write_postgres_conf (line 49) | pub fn write_postgres_conf(
  function with_compute_ctl_tmp_override (line 385) | pub fn with_compute_ctl_tmp_override<F>(pgdata_path: &Path, options: &st...

FILE: compute_tools/src/configurator.rs
  function configurator_main_loop (line 13) | fn configurator_main_loop(compute: &Arc<ComputeNode>) {
  function launch_configurator (line 197) | pub fn launch_configurator(compute: &Arc<ComputeNode>) -> thread::JoinHa...

FILE: compute_tools/src/disk_quota.rs
  constant DISK_QUOTA_BIN (line 4) | pub const DISK_QUOTA_BIN: &str = "/neonvm/bin/set-disk-quota";
  function set_disk_quota (line 9) | pub fn set_disk_quota(size_bytes: u64, fs_mountpoint: &str) -> anyhow::R...

FILE: compute_tools/src/extension_server.rs
  function get_pg_config (line 91) | fn get_pg_config(argument: &str, pgbin: &str) -> String {
  function get_pg_version (line 109) | pub fn get_pg_version(pgbin: &str) -> PgMajorVersion {
  function get_pg_version_string (line 116) | pub fn get_pg_version_string(pgbin: &str) -> String {
  function parse_pg_version (line 120) | fn parse_pg_version(human_version: &str) -> PgMajorVersion {
  function download_extension (line 145) | pub async fn download_extension(
  function create_control_files (line 229) | pub fn create_control_files(remote_extensions: &RemoteExtSpec, pgbin: &s...
  function download_extension_tar (line 262) | async fn download_extension_tar(remote_ext_base_url: &Url, ext_path: &st...
  function do_extension_server_request (line 296) | async fn do_extension_server_request(uri: Url) -> Result<Bytes, (String,...
  function test_parse_pg_version (line 331) | fn test_parse_pg_version() {
  function test_parse_pg_unsupported_version (line 355) | fn test_parse_pg_unsupported_version() {
  function test_parse_pg_incorrect_version_format (line 361) | fn test_parse_pg_incorrect_version_format() {

FILE: compute_tools/src/hadron_metrics.rs
  function collect (line 48) | pub fn collect() -> Vec<MetricFamily> {
  function initialize_metrics (line 56) | pub fn initialize_metrics() {

FILE: compute_tools/src/http/extract/json.rs
  type Json (line 11) | pub(crate) struct Json<T>(pub T);
  type Rejection (line 18) | type Rejection = (StatusCode, axum::Json<GenericAPIError>);
  function from_request (line 20) | async fn from_request(req: Request, state: &S) -> Result<Self, Self::Rej...
  type Target (line 34) | type Target = T;
  method deref (line 36) | fn deref(&self) -> &Self::Target {
  method deref_mut (line 42) | fn deref_mut(&mut self) -> &mut Self::Target {

FILE: compute_tools/src/http/extract/path.rs
  type Path (line 12) | pub(crate) struct Path<T>(pub T);
  type Rejection (line 19) | type Rejection = (StatusCode, axum::Json<GenericAPIError>);
  function from_request_parts (line 21) | async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self...
  type Target (line 35) | type Target = T;
  method deref (line 37) | fn deref(&self) -> &Self::Target {
  method deref_mut (line 43) | fn deref_mut(&mut self) -> &mut Self::Target {

FILE: compute_tools/src/http/extract/query.rs
  type Query (line 12) | pub(crate) struct Query<T>(pub T);
  type Rejection (line 19) | type Rejection = (StatusCode, axum::Json<GenericAPIError>);
  function from_request_parts (line 21) | async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self...
  type Target (line 35) | type Target = T;
  method deref (line 37) | fn deref(&self) -> &Self::Target {
  method deref_mut (line 43) | fn deref_mut(&mut self) -> &mut Self::Target {

FILE: compute_tools/src/http/extract/request_id.rs
  type RequestId (line 13) | pub(crate) struct RequestId(pub String);
    type Rejection (line 55) | type Rejection = RequestIdRejection;
    method from_request_parts (line 57) | async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<S...
  type RequestIdRejection (line 20) | pub(crate) enum RequestIdRejection {
    method status (line 29) | pub fn status(&self) -> StatusCode {
    method message (line 36) | pub fn message(&self) -> String {
  method into_response (line 46) | fn into_response(self) -> axum::response::Response {
  type Target (line 69) | type Target = String;
  method deref (line 71) | fn deref(&self) -> &Self::Target {
  method deref_mut (line 77) | fn deref_mut(&mut self) -> &mut Self::Target {
  method fmt (line 83) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

FILE: compute_tools/src/http/headers.rs
  constant X_REQUEST_ID (line 2) | pub const X_REQUEST_ID: &str = "x-request-id";

FILE: compute_tools/src/http/middleware/authorize.rs
  type Authorize (line 17) | pub(in crate::http) struct Authorize {
    method new (line 28) | pub fn new(compute_id: String, instance_id: Option<String>, jwks: JwkS...
    type RequestBody (line 61) | type RequestBody = Body;
    type ResponseBody (line 62) | type ResponseBody = Body;
    type Future (line 63) | type Future = BoxFuture<'static, Result<Request<Body>, Response<Self::...
    method authorize (line 65) | fn authorize(&mut self, mut request: Request<Body>) -> Self::Future {
    method verify (line 147) | fn verify(

FILE: compute_tools/src/http/middleware/request_id.rs
  function maybe_add_request_id_header (line 9) | pub async fn maybe_add_request_id_header(mut request: Request, next: Nex...

FILE: compute_tools/src/http/mod.rs
  type JsonResponse (line 16) | struct JsonResponse;
    method create_response (line 20) | fn create_response(code: StatusCode, body: impl Serialize) -> Response {
    method success (line 29) | pub(self) fn success(code: StatusCode, body: impl Serialize) -> Respon...
    method error (line 40) | pub(self) fn error(code: StatusCode, error: impl ToString) -> Response {
    method invalid_status (line 50) | pub(self) fn invalid_status(status: ComputeStatus) -> Response {

FILE: compute_tools/src/http/routes/check_writability.rs
  function is_writable (line 13) | pub(in crate::http) async fn is_writable(State(compute): State<Arc<Compu...

FILE: compute_tools/src/http/routes/configure.rs
  function configure (line 21) | pub(in crate::http) async fn configure(

FILE: compute_tools/src/http/routes/database_schema.rs
  type DatabaseSchemaParams (line 16) | pub(in crate::http) struct DatabaseSchemaParams {
  function get_schema_dump (line 21) | pub(in crate::http) async fn get_schema_dump(

FILE: compute_tools/src/http/routes/dbs_and_roles.rs
  function get_catalog_objects (line 12) | pub(in crate::http) async fn get_catalog_objects(

FILE: compute_tools/src/http/routes/extension_server.rs
  type ExtensionServerParams (line 13) | pub(in crate::http) struct ExtensionServerParams {
  function download_extension (line 19) | pub(in crate::http) async fn download_extension(

FILE: compute_tools/src/http/routes/extensions.rs
  function install_extension (line 14) | pub(in crate::http) async fn install_extension(

FILE: compute_tools/src/http/routes/failpoints.rs
  type ConfigureFailpointsRequest (line 7) | pub type ConfigureFailpointsRequest = Vec<FailpointConfig>;
  type FailpointConfig (line 11) | pub struct FailpointConfig {
  function configure_failpoints (line 24) | pub(in crate::http) async fn configure_failpoints(

FILE: compute_tools/src/http/routes/grants.rs
  function add_grant (line 14) | pub(in crate::http) async fn add_grant(

FILE: compute_tools/src/http/routes/hadron_liveness_probe.rs
  function hadron_liveness_probe (line 9) | pub(in crate::http) async fn hadron_liveness_probe(

FILE: compute_tools/src/http/routes/insights.rs
  function get_insights (line 12) | pub(in crate::http) async fn get_insights(State(compute): State<Arc<Comp...

FILE: compute_tools/src/http/routes/lfc.rs
  type Compute (line 6) | type Compute = axum::extract::State<std::sync::Arc<crate::compute::Compu...
  function prewarm_state (line 8) | pub(in crate::http) async fn prewarm_state(compute: Compute) -> Json<Lfc...
  function offload_state (line 15) | pub(in crate::http) async fn offload_state(compute: Compute) -> Json<Lfc...
  type PrewarmQuery (line 20) | pub struct PrewarmQuery {
  function prewarm (line 24) | pub(in crate::http) async fn prewarm(
  function offload (line 38) | pub(in crate::http) async fn offload(compute: Compute) -> Response {
  function cancel_prewarm (line 49) | pub(in crate::http) async fn cancel_prewarm(compute: Compute) -> StatusC...

FILE: compute_tools/src/http/routes/metrics.rs
  function get_metrics (line 21) | pub(in crate::http) async fn get_metrics() -> Response {
  function get_autoscaling_metrics (line 57) | pub(in crate::http) async fn get_autoscaling_metrics(

FILE: compute_tools/src/http/routes/metrics_json.rs
  function get_metrics (line 11) | pub(in crate::http) async fn get_metrics(State(compute): State<Arc<Compu...

FILE: compute_tools/src/http/routes/mod.rs
  method from (line 24) | fn from(state: &ComputeState) -> Self {

FILE: compute_tools/src/http/routes/promote.rs
  function promote (line 6) | pub(in crate::http) async fn promote(

FILE: compute_tools/src/http/routes/refresh_configuration.rs
  function refresh_configuration (line 21) | pub(in crate::http) async fn refresh_configuration(

FILE: compute_tools/src/http/routes/status.rs
  function get_status (line 13) | pub(in crate::http) async fn get_status(State(compute): State<Arc<Comput...

FILE: compute_tools/src/http/routes/terminate.rs
  type TerminateQuery (line 14) | pub struct TerminateQuery {
  function terminate (line 19) | pub(in crate::http) async fn terminate(

FILE: compute_tools/src/http/server.rs
  type Server (line 39) | pub enum Server {
    method handle_404 (line 177) | async fn handle_404() -> impl IntoResponse {
    method handle_405 (line 181) | async fn handle_405() -> impl IntoResponse {
    method listener (line 185) | async fn listener(&self) -> Result<TcpListener> {
    method ip (line 192) | fn ip(&self) -> IpAddr {
    method port (line 201) | fn port(&self) -> u16 {
    method serve (line 208) | async fn serve(self, compute: Arc<ComputeNode>) {
    method launch (line 240) | pub fn launch(self, compute: &Arc<ComputeNode>) {
  method fmt (line 52) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function from (line 61) | fn from(server: &Server) -> Self {

FILE: compute_tools/src/installed_extensions.rs
  function list_dbs (line 15) | async fn list_dbs(client: &mut Client) -> Result<Vec<String>, PostgresEr...
  function get_installed_extensions (line 42) | pub async fn get_installed_extensions(
  function initialize_metrics (line 124) | pub fn initialize_metrics() {

FILE: compute_tools/src/local_proxy.rs
  function configure (line 12) | pub fn configure(local_proxy: &LocalProxySpec) -> Result<()> {
  function write_local_proxy_conf (line 20) | fn write_local_proxy_conf(path: &Utf8Path, local_proxy: &LocalProxySpec)...
  function notify_local_proxy (line 29) | fn notify_local_proxy(path: &Utf8Path) -> Result<()> {

FILE: compute_tools/src/logger.rs
  function init_tracing_and_logging (line 19) | pub fn init_tracing_and_logging(
  function inlinify (line 80) | pub fn inlinify(s: &str) -> String {
  function startup_context_from_env (line 84) | pub fn startup_context_from_env() -> Option<opentelemetry::Context> {
  constant UNKNOWN_IDS (line 132) | const UNKNOWN_IDS: &str = r#""pg_instance_id": "", "pg_compute_id": """#;
  function update_ids (line 135) | pub fn update_ids(instance_id: &Option<String>, compute_id: &Option<Stri...
  type PgJsonLogShapeFormatter (line 149) | struct PgJsonLogShapeFormatter;
    method format_event (line 155) | fn format_event(
  type StaticStringWriter (line 207) | struct StaticStringWriter;
    method write (line 210) | fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
    method flush (line 216) | fn flush(&mut self) -> io::Result<()> {
    type Writer (line 222) | type Writer = Self;
    method make_writer (line 224) | fn make_writer(&self) -> Self::Writer {
  function test_log_pg_json_shape_formatter (line 230) | fn test_log_pg_json_shape_formatter() {

FILE: compute_tools/src/lsn_lease.rs
  function launch_lsn_lease_bg_task_for_static (line 19) | pub fn launch_lsn_lease_bg_task_for_static(compute: &Arc<ComputeNode>) {
  function lsn_lease_bg_task (line 41) | fn lsn_lease_bg_task(
  function acquire_lsn_lease_with_retry (line 68) | fn acquire_lsn_lease_with_retry(
  function try_acquire_lsn_lease (line 112) | fn try_acquire_lsn_lease(
  function acquire_lsn_lease_libpq (line 158) | fn acquire_lsn_lease_libpq(
  function acquire_lsn_lease_grpc (line 194) | fn acquire_lsn_lease_grpc(

FILE: compute_tools/src/metrics.rs
  type CPlaneRequestRPC (line 21) | pub enum CPlaneRequestRPC {
    method as_str (line 26) | pub fn as_str(&self) -> &str {
  constant UNKNOWN_HTTP_STATUS (line 33) | pub const UNKNOWN_HTTP_STATUS: &str = "unknown";
  function collect (line 132) | pub fn collect() -> Vec<MetricFamily> {

FILE: compute_tools/src/migration.rs
  type MigrationRunner (line 9) | pub(crate) struct MigrationRunner<'m> {
  function new (line 17) | pub fn new(client: &'m mut Client, migrations: &'m [&'m str], lakebase_m...
  function get_migration_id (line 29) | async fn get_migration_id(&mut self) -> Result<i64> {
  function update_migration_id (line 43) | async fn update_migration_id(txn: &mut Transaction<'_>, migration_id: i6...
  function prepare_database (line 75) | async fn prepare_database(&mut self) -> Result<()> {
  function run_migration (line 96) | async fn run_migration(client: &mut Client, migration_id: i64, migration...
  function run_migrations (line 127) | pub async fn run_migrations(mut self) -> Result<()> {

FILE: compute_tools/src/monitor.rs
  constant PG_DEFAULT_INIT_TIMEOUIT (line 14) | const PG_DEFAULT_INIT_TIMEOUIT: Duration = Duration::from_secs(60);
  constant MONITOR_CHECK_INTERVAL (line 15) | const MONITOR_CHECK_INTERVAL: Duration = Duration::from_millis(500);
  type ComputeMonitor (line 23) | struct ComputeMonitor {
    method report_down (line 50) | fn report_down(&self) {
    method report_up (line 66) | fn report_up(&mut self) {
    method downtime_info (line 71) | fn downtime_info(&self) -> String {
    method check_interrupts (line 83) | fn check_interrupts(&mut self) -> bool {
    method run (line 112) | pub fn run(&mut self) -> anyhow::Result<()> {
    method check (line 206) | fn check(&mut self, cli: &mut Client) -> anyhow::Result<()> {
  function wait_for_postgres_start (line 354) | fn wait_for_postgres_start(compute: &ComputeNode) {
  function get_database_stats (line 405) | fn get_database_stats(cli: &mut Client) -> anyhow::Result<(f64, i64)> {
  function get_backends_state_change (line 444) | fn get_backends_state_change(cli: &mut Client) -> anyhow::Result<Option<...
  function launch_monitor (line 500) | pub fn launch_monitor(compute: &Arc<ComputeNode>) -> thread::JoinHandle<...

FILE: compute_tools/src/params.rs
  constant DEFAULT_LOG_LEVEL (line 1) | pub const DEFAULT_LOG_LEVEL: &str = "info";
  constant PG_HBA_ALL_MD5 (line 9) | pub const PG_HBA_ALL_MD5: &str = "host\tall\t\tall\t\tall\t\tmd5";

FILE: compute_tools/src/pg_helpers.rs
  constant POSTGRES_WAIT_TIMEOUT (line 29) | const POSTGRES_WAIT_TIMEOUT: Duration = Duration::from_millis(60 * 1000);
  function escape_literal (line 37) | pub fn escape_literal(s: &str) -> String {
  function escape_conf_value (line 49) | pub fn escape_conf_value(s: &str) -> String {
  type GenericOptionExt (line 54) | pub trait GenericOptionExt {
    method to_pg_option (line 55) | fn to_pg_option(&self) -> String;
    method to_pg_setting (line 56) | fn to_pg_setting(&self) -> String;
    method to_pg_option (line 61) | fn to_pg_option(&self) -> String {
    method to_pg_setting (line 73) | fn to_pg_setting(&self) -> String {
  type PgOptionsSerialize (line 85) | pub trait PgOptionsSerialize {
    method as_pg_options (line 86) | fn as_pg_options(&self) -> String;
    method as_pg_settings (line 87) | fn as_pg_settings(&self) -> String;
    method as_pg_options (line 93) | fn as_pg_options(&self) -> String {
    method as_pg_settings (line 106) | fn as_pg_settings(&self) -> String {
  type GenericOptionsSearch (line 119) | pub trait GenericOptionsSearch {
    method find (line 120) | fn find(&self, name: &str) -> Option<String>;
    method find_ref (line 121) | fn find_ref(&self, name: &str) -> Option<&GenericOption>;
    method find (line 126) | fn find(&self, name: &str) -> Option<String> {
    method find_ref (line 133) | fn find_ref(&self, name: &str) -> Option<&GenericOption> {
  type RoleExt (line 139) | pub trait RoleExt {
    method to_pg_options (line 140) | fn to_pg_options(&self) -> String;
    method to_pg_options (line 146) | fn to_pg_options(&self) -> String {
  type DatabaseExt (line 170) | pub trait DatabaseExt {
    method to_pg_options (line 171) | fn to_pg_options(&self) -> String;
    method to_pg_options (line 180) | fn to_pg_options(&self) -> String {
  type DatabricksSettingsExt (line 189) | pub trait DatabricksSettingsExt {
    method as_pg_settings (line 190) | fn as_pg_settings(&self) -> String;
    method as_pg_settings (line 194) | fn as_pg_settings(&self) -> String {
  type Escaping (line 227) | pub trait Escaping {
    method pg_quote (line 228) | fn pg_quote(&self) -> String;
    method pg_quote_dollar (line 229) | fn pg_quote_dollar(&self) -> (String, String);
    method pg_quote (line 238) | fn pg_quote(&self) -> String {
    method pg_quote_dollar (line 248) | fn pg_quote_dollar(&self) -> (String, String) {
  function get_existing_roles_async (line 269) | pub async fn get_existing_roles_async(client: &tokio_postgres::Client) -...
  function get_existing_dbs_async (line 289) | pub async fn get_existing_dbs_async(
  function wait_for_postgres (line 331) | pub fn wait_for_postgres(pg: &mut Child, pgdata: &Path) -> Result<()> {
  function create_pgdata (line 439) | pub fn create_pgdata(pgdata: &str) -> Result<()> {
  function update_pgbouncer_ini (line 450) | fn update_pgbouncer_ini(
  function tune_pgbouncer (line 472) | pub async fn tune_pgbouncer(
  function handle_postgres_logs (line 564) | pub fn handle_postgres_logs(stderr: std::process::ChildStderr) -> JoinHa...
  function handle_postgres_logs_async (line 575) | async fn handle_postgres_logs_async(stderr: tokio::process::ChildStderr)...
  function postgres_conf_for_db (line 622) | pub fn postgres_conf_for_db(connstr: &url::Url, dbname: &str) -> Result<...

FILE: compute_tools/src/pg_isready.rs
  function pg_isready (line 8) | pub fn pg_isready(bin: &str, port: u16) -> anyhow::Result<()> {
  function get_pg_isready_bin (line 27) | pub fn get_pg_isready_bin(pgbin: &str) -> String {

FILE: compute_tools/src/pgbouncer.rs
  constant PGBOUNCER_PIDFILE (line 1) | pub const PGBOUNCER_PIDFILE: &str = "/tmp/pgbouncer.pid";

FILE: compute_tools/src/rsyslog.rs
  constant POSTGRES_LOGS_CONF_PATH (line 13) | const POSTGRES_LOGS_CONF_PATH: &str = "/etc/rsyslog.d/postgres_logs.conf";
  function get_rsyslog_pid (line 15) | fn get_rsyslog_pid() -> Option<String> {
  function wait_for_rsyslog_pid (line 32) | fn wait_for_rsyslog_pid() -> Result<String, anyhow::Error> {
  function restart_rsyslog (line 74) | fn restart_rsyslog() -> Result<()> {
  function parse_audit_syslog_address (line 87) | fn parse_audit_syslog_address(
  function generate_audit_rsyslog_config (line 130) | fn generate_audit_rsyslog_config(
  function configure_audit_rsyslog (line 149) | pub fn configure_audit_rsyslog(
  type PostgresLogsRsyslogConfig (line 190) | pub struct PostgresLogsRsyslogConfig<'a> {
  function new (line 195) | pub fn new(host: Option<&'a str>) -> Self {
  function build (line 199) | pub fn build(&self) -> Result<String> {
  function current_config (line 218) | fn current_config() -> Result<String> {
  function configure_postgres_logs_export (line 229) | pub fn configure_postgres_logs_export(conf: PostgresLogsRsyslogConfig) -...
  function pgaudit_gc_main_loop (line 268) | async fn pgaudit_gc_main_loop(log_directory: String) -> Result<()> {
  function launch_pgaudit_gc (line 317) | pub fn launch_pgaudit_gc(log_directory: String) {
  function test_postgres_logs_config (line 332) | fn test_postgres_logs_config() {
  function test_parse_audit_syslog_address (line 362) | fn test_parse_audit_syslog_address() {
  function test_generate_audit_rsyslog_config (line 451) | fn test_generate_audit_rsyslog_config() {

FILE: compute_tools/src/spec.rs
  function do_control_plane_request (line 23) | fn do_control_plane_request(
  function get_config_from_control_plane (line 77) | pub fn get_config_from_control_plane(base_uri: &str, compute_id: &str) -...
  function update_pg_hba (line 138) | pub fn update_pg_hba(pgdata_path: &Path, databricks_pg_hba: Option<&Stri...
  function update_pg_ident (line 167) | pub fn update_pg_ident(pgdata_path: &Path, databricks_pg_ident: Option<&...
  function copy_tls_certificates (line 191) | pub fn copy_tls_certificates(
  function add_standby_signal (line 220) | pub fn add_standby_signal(pgdata_path: &Path) -> Result<()> {
  function handle_neon_extension_upgrade (line 234) | pub async fn handle_neon_extension_upgrade(client: &mut Client) -> Resul...
  function handle_migrations (line 243) | pub async fn handle_migrations(

FILE: compute_tools/src/spec_apply.rs
  method apply_spec_sql (line 40) | pub fn apply_spec_sql(
  method apply_spec_sql_db (line 362) | async fn apply_spec_sql_db(
  method max_service_connections (line 410) | pub fn max_service_connections(
  type DB (line 480) | pub enum DB {
    method new (line 486) | pub fn new(db: Database) -> DB {
    method is_owned_by (line 490) | pub fn is_owned_by(&self, role: &PgIdent) -> bool {
  method fmt (line 499) | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
  type PerDatabasePhase (line 508) | pub enum PerDatabasePhase {
  type ApplySpecPhase (line 520) | pub enum ApplySpecPhase {
  type Operation (line 550) | pub struct Operation {
  type MutableApplyContext (line 555) | pub struct MutableApplyContext {
  function apply_operations (line 574) | pub async fn apply_operations<'a, Fut, F>(
  function get_operations (line 671) | async fn get_operations<'a>(

FILE: compute_tools/src/sql/create_databricks_misc.sql
  function health_check_write_succeeds (line 3) | CREATE OR REPLACE FUNCTION health_check_write_succeeds()

FILE: compute_tools/src/swap.rs
  constant RESIZE_SWAP_BIN (line 6) | pub const RESIZE_SWAP_BIN: &str = "/neonvm/bin/resize-swap";
  function resize_swap (line 9) | pub fn resize_swap(size_bytes: u64) -> anyhow::Result<()> {

FILE: compute_tools/src/sync_sk.rs
  type TimelineStatusResponse (line 7) | pub enum TimelineStatusResponse {
  type TimelineStatusOkResponse (line 13) | pub struct TimelineStatusOkResponse {
  function ping_safekeeper (line 19) | pub async fn ping_safekeeper(
  function check_if_synced (line 54) | pub fn check_if_synced(responses: Vec<TimelineStatusResponse>) -> Option...

FILE: compute_tools/src/tls.rs
  type CertDigest (line 9) | pub struct CertDigest(digest::Digest);
  function watch_cert_for_changes (line 11) | pub async fn watch_cert_for_changes(cert_path: String) -> tokio::sync::w...
  function compute_digest (line 28) | async fn compute_digest(cert_path: &str) -> CertDigest {
  function try_compute_digest (line 40) | async fn try_compute_digest(cert_path: &str) -> Result<CertDigest> {
  constant SERVER_CRT (line 46) | pub const SERVER_CRT: &str = "server.crt";
  constant SERVER_KEY (line 47) | pub const SERVER_KEY: &str = "server.key";
  function update_key_path_blocking (line 49) | pub fn update_key_path_blocking(pg_data: &Path, tls_config: &TlsConfig) {
  function try_update_key_path_blocking (line 64) | fn try_update_key_path_blocking(pg_data: &Path, tls_config: &TlsConfig) ...
  function verify_key_cert (line 91) | fn verify_key_cert(key: &str, cert: &str) -> Result<()> {
  constant CERT (line 130) | const CERT: &str = "
  constant KEY (line 174) | const KEY: &str = "
  constant INCORRECT_KEY (line 183) | const INCORRECT_KEY: &str = "
  function certificate_verification (line 192) | fn certificate_verification() {
  function certificate_verification_fail (line 198) | fn certificate_verification_fail() {

FILE: compute_tools/tests/config_test.rs
  function write_test_file (line 10) | fn write_test_file(path: &Path, content: &str) {
  function check_file_content (line 15) | fn check_file_content(path: &Path, expected_content: &str) {
  function test_line_in_file (line 24) | fn test_line_in_file() {

FILE: compute_tools/tests/pg_helpers_tests.rs
  function params_serialize (line 9) | fn params_serialize() {
  function settings_serialize (line 24) | fn settings_serialize() {
  function ident_pg_quote (line 60) | fn ident_pg_quote() {
  function ident_pg_quote_dollar (line 67) | fn ident_pg_quote_dollar() {
  function generic_options_search (line 93) | fn generic_options_search() {
  function test_escape_literal (line 122) | fn test_escape_literal() {

FILE: control_plane/src/background_process.rs
  constant STOP_RETRY_TIMEOUT (line 39) | const STOP_RETRY_TIMEOUT: Duration = Duration::from_secs(10);
  constant STOP_RETRIES (line 40) | const STOP_RETRIES: u128 = STOP_RETRY_TIMEOUT.as_millis() / RETRY_INTERV...
  constant RETRY_INTERVAL (line 41) | const RETRY_INTERVAL: Duration = Duration::from_millis(100);
  constant DOT_EVERY_RETRIES (line 42) | const DOT_EVERY_RETRIES: u128 = 10;
  constant NOTICE_AFTER_RETRIES (line 43) | const NOTICE_AFTER_RETRIES: u128 = 50;
  type InitialPidFile (line 47) | pub enum InitialPidFile {
  function start_process (line 56) | pub async fn start_process<F, Fut, AI, A, EI>(
  function stop_process (line 170) | pub fn stop_process(
  function wait_until_stopped (line 221) | pub fn wait_until_stopped(process_name: &str, pid: Pid) -> anyhow::Resul...
  function fill_rust_env_vars (line 253) | fn fill_rust_env_vars(cmd: &mut Command) -> &mut Command {
  function fill_remote_storage_secrets_vars (line 279) | fn fill_remote_storage_secrets_vars(mut cmd: &mut Command) -> &mut Comma...
  function fill_env_vars_prefixed_neon (line 297) | fn fill_env_vars_prefixed_neon(mut cmd: &mut Command) -> &mut Command {
  function pre_exec_create_pidfile (line 310) | fn pre_exec_create_pidfile<P>(cmd: &mut Command, path: P) -> &mut Command
  function process_started (line 369) | async fn process_started<F, Fut>(
  function process_has_stopped (line 389) | pub(crate) fn process_has_stopped(pid: Pid) -> anyhow::Result<bool> {

FILE: control_plane/src/bin/neon_local.rs
  constant DEFAULT_SAFEKEEPER_ID (line 63) | const DEFAULT_SAFEKEEPER_ID: NodeId = NodeId(1);
  constant DEFAULT_PAGESERVER_ID (line 64) | const DEFAULT_PAGESERVER_ID: NodeId = NodeId(1);
  constant DEFAULT_BRANCH_NAME (line 65) | const DEFAULT_BRANCH_NAME: &str = "main";
  constant DEFAULT_PG_VERSION (line 69) | const DEFAULT_PG_VERSION: PgMajorVersion = PgMajorVersion::PG17;
  constant DEFAULT_PG_VERSION_NUM (line 70) | const DEFAULT_PG_VERSION_NUM: &str = "17";
  constant DEFAULT_PAGESERVER_CONTROL_PLANE_API (line 72) | const DEFAULT_PAGESERVER_CONTROL_PLANE_API: &str = "http://127.0.0.1:123...
  type Cli (line 77) | struct Cli {
  type NeonLocalCmd (line 83) | enum NeonLocalCmd {
  type InitCmdArgs (line 113) | struct InitCmdArgs {
  type StartCmdArgs (line 129) | struct StartCmdArgs {
  type StopCmdArgs (line 136) | struct StopCmdArgs {
  type StopMode (line 143) | enum StopMode {
  type TenantCmd (line 150) | enum TenantCmd {
  type TenantCreateCmdArgs (line 159) | struct TenantCreateCmdArgs {
  function parse_placement_policy (line 194) | fn parse_placement_policy(s: &str) -> anyhow::Result<PlacementPolicy> {
  type TenantSetDefaultCmdArgs (line 201) | struct TenantSetDefaultCmdArgs {
  type TenantConfigCmdArgs (line 208) | struct TenantConfigCmdArgs {
  type TenantImportCmdArgs (line 219) | struct TenantImportCmdArgs {
  type TimelineCmd (line 227) | enum TimelineCmd {
  type TimelineListCmdArgs (line 236) | struct TimelineListCmdArgs {
  type TimelineBranchCmdArgs (line 244) | struct TimelineBranchCmdArgs {
  type TimelineCreateCmdArgs (line 265) | struct TimelineCreateCmdArgs {
  type TimelineImportCmdArgs (line 284) | struct TimelineImportCmdArgs {
  type PageserverCmd (line 315) | enum PageserverCmd {
  type PageserverStatusCmdArgs (line 324) | struct PageserverStatusCmdArgs {
  type PageserverStartCmdArgs (line 332) | struct PageserverStartCmdArgs {
  type PageserverStopCmdArgs (line 344) | struct PageserverStopCmdArgs {
  type PageserverRestartCmdArgs (line 356) | struct PageserverRestartCmdArgs {
  type StorageControllerCmd (line 368) | enum StorageControllerCmd {
  type StorageControllerStartCmdArgs (line 375) | struct StorageControllerStartCmdArgs {
  type StorageControllerStopCmdArgs (line 396) | struct StorageControllerStopCmdArgs {
  type StorageBrokerCmd (line 409) | enum StorageBrokerCmd {
  type StorageBrokerStartCmdArgs (line 416) | struct StorageBrokerStartCmdArgs {
  type StorageBrokerStopCmdArgs (line 424) | struct StorageBrokerStopCmdArgs {
  type SafekeeperCmd (line 433) | enum SafekeeperCmd {
  type EndpointStorageCmd (line 441) | enum EndpointStorageCmd {
  type EndpointStorageStartCmd (line 448) | struct EndpointStorageStartCmd {
  type EndpointStorageStopCmd (line 457) | struct EndpointStorageStopCmd {
  type SafekeeperStartCmdArgs (line 466) | struct SafekeeperStartCmdArgs {
  type SafekeeperStopCmdArgs (line 483) | struct SafekeeperStopCmdArgs {
  type SafekeeperRestartCmdArgs (line 496) | struct SafekeeperRestartCmdArgs {
  type EndpointCmd (line 518) | enum EndpointCmd {
  type EndpointListCmdArgs (line 531) | struct EndpointListCmdArgs {
  type EndpointCreateCmdArgs (line 539) | struct EndpointCreateCmdArgs {
  type EndpointStartCmdArgs (line 596) | struct EndpointStartCmdArgs {
  type EndpointReconfigureCmdArgs (line 638) | struct EndpointReconfigureCmdArgs {
  type EndpointRefreshConfigurationArgs (line 653) | struct EndpointRefreshConfigurationArgs {
  type EndpointStopCmdArgs (line 660) | struct EndpointStopCmdArgs {
  type EndpointUpdatePageserversCmdArgs (line 675) | struct EndpointUpdatePageserversCmdArgs {
  type EndpointGenerateJwtCmdArgs (line 686) | struct EndpointGenerateJwtCmdArgs {
  type MappingsCmd (line 696) | enum MappingsCmd {
  type MappingsMapCmdArgs (line 702) | struct MappingsMapCmdArgs {
  type TimelineTreeEl (line 717) | struct TimelineTreeEl {
  type RepoLock (line 727) | struct RepoLock {
    method new (line 732) | fn new() -> Result<Self> {
  function main (line 748) | fn main() -> Result<()> {
  function print_timelines_tree (line 810) | fn print_timelines_tree(
  function print_timeline (line 853) | fn print_timeline(
  function get_tenant_id (line 923) | fn get_tenant_id(
  function get_tenant_shard_id (line 938) | fn get_tenant_shard_id(
  function handle_init (line 951) | fn handle_init(args: &InitCmdArgs) -> anyhow::Result<LocalEnv> {
  function get_default_pageserver (line 1026) | fn get_default_pageserver(env: &local_env::LocalEnv) -> PageServerNode {
  function handle_tenant (line 1034) | async fn handle_tenant(subcmd: &TenantCmd, env: &mut local_env::LocalEnv...
  function handle_timeline (line 1178) | async fn handle_timeline(cmd: &TimelineCmd, env: &mut local_env::LocalEn...
  function handle_endpoint (line 1319) | async fn handle_endpoint(subcmd: &EndpointCmd, env: &local_env::LocalEnv...
  function parse_safekeepers (line 1647) | fn parse_safekeepers(safekeepers_str: &Option<String>) -> Result<Option<...
  function handle_mappings (line 1663) | fn handle_mappings(subcmd: &MappingsCmd, env: &mut local_env::LocalEnv) ...
  function get_pageserver (line 1677) | fn get_pageserver(
  function handle_pageserver (line 1689) | async fn handle_pageserver(subcmd: &PageserverCmd, env: &local_env::Loca...
  function handle_storage_controller (line 1742) | async fn handle_storage_controller(
  function get_safekeeper (line 1779) | fn get_safekeeper(env: &local_env::LocalEnv, id: NodeId) -> Result<Safek...
  function handle_safekeeper (line 1787) | async fn handle_safekeeper(subcmd: &SafekeeperCmd, env: &local_env::Loca...
  function handle_endpoint_storage (line 1831) | async fn handle_endpoint_storage(
  function handle_storage_broker (line 1869) | async fn handle_storage_broker(subcmd: &StorageBrokerCmd, env: &local_en...
  function handle_start_all (line 1891) | async fn handle_start_all(
  function handle_start_all_impl (line 1920) | async fn handle_start_all_impl(
  function neon_start_status_check (line 1992) | async fn neon_start_status_check(
  function handle_stop_all (line 2046) | async fn handle_stop_all(args: &StopCmdArgs, env: &local_env::LocalEnv) ...
  function try_stop_all (line 2057) | async fn try_stop_all(env: &local_env::LocalEnv, immediate: bool) {

FILE: control_plane/src/branch_mappings.rs
  type BranchMappings (line 15) | pub struct BranchMappings {
    method register_branch_mapping (line 27) | pub fn register_branch_mapping(
    method get_branch_timeline_id (line 51) | pub fn get_branch_timeline_id(
    method timeline_name_mappings (line 69) | pub fn timeline_name_mappings(&self) -> HashMap<TenantTimelineId, Stri...
    method persist (line 80) | pub fn persist(&self, path: &Path) -> anyhow::Result<()> {
    method load (line 90) | pub fn load(path: &Path) -> anyhow::Result<BranchMappings> {

FILE: control_plane/src/broker.rs
  type StorageBroker (line 15) | pub struct StorageBroker {
    method from_env (line 21) | pub fn from_env(env: &LocalEnv) -> Self {
    method initialize (line 25) | pub fn initialize(&self) -> anyhow::Result<()> {
    method start (line 36) | pub async fn start(&self, retry_timeout: &Duration) -> anyhow::Result<...
    method stop (line 79) | pub fn stop(&self) -> anyhow::Result<()> {
    method pid_file_path (line 84) | fn pid_file_path(&self) -> Utf8PathBuf {

FILE: control_plane/src/endpoint.rs
  type EndpointConf (line 92) | pub struct EndpointConf {
  type ComputeControlPlane (line 114) | pub struct ComputeControlPlane {
    method load (line 125) | pub fn load(env: LocalEnv) -> Result<ComputeControlPlane> {
    method get_port (line 155) | fn get_port(&mut self) -> u16 {
    method create_jwks_from_pem (line 166) | fn create_jwks_from_pem(pem: &Pem) -> Result<JwkSet> {
    method new_endpoint (line 196) | pub fn new_endpoint(
    method check_conflicting_endpoints (line 283) | pub fn check_conflicting_endpoints(
  type Endpoint (line 312) | pub struct Endpoint {
    method from_dir_entry (line 406) | fn from_dir_entry(entry: std::fs::DirEntry, env: &LocalEnv) -> Result<...
    method create_endpoint_dir (line 451) | fn create_endpoint_dir(&self) -> Result<()> {
    method setup_pg_conf (line 461) | fn setup_pg_conf(&self) -> Result<PostgresConf> {
    method endpoint_path (line 577) | pub fn endpoint_path(&self) -> PathBuf {
    method pgdata (line 581) | pub fn pgdata(&self) -> PathBuf {
    method status (line 585) | pub fn status(&self) -> EndpointStatus {
    method pg_ctl (line 598) | fn pg_ctl(&self, args: &[&str], auth_token: &Option<String>) -> Result...
    method wait_for_compute_ctl_to_exit (line 642) | fn wait_for_compute_ctl_to_exit(&self, send_sigterm: bool) -> Result<(...
    method read_postgresql_conf (line 654) | fn read_postgresql_conf(&self) -> Result<String> {
    method build_safekeepers_connstrs (line 671) | fn build_safekeepers_connstrs(&self, sk_ids: Vec<NodeId>) -> Result<Ve...
    method generate_jwt (line 688) | pub fn generate_jwt(&self, scope: Option<ComputeClaimsScope>) -> Resul...
    method start (line 702) | pub async fn start(&self, args: EndpointStartArgs) -> Result<()> {
    method update_pageservers_in_config (line 1000) | pub async fn update_pageservers_in_config(
    method get_status (line 1021) | pub async fn get_status(&self) -> Result<ComputeStatusResponse> {
    method reconfigure (line 1052) | pub async fn reconfigure(
    method reconfigure_pageservers (line 1124) | pub async fn reconfigure_pageservers(
    method reconfigure_safekeepers (line 1131) | pub async fn reconfigure_safekeepers(
    method stop (line 1140) | pub async fn stop(
    method refresh_configuration (line 1182) | pub async fn refresh_configuration(&self) -> Result<()> {
    method connstr (line 1209) | pub fn connstr(&self, user: &str, db_name: &str) -> String {
  type EndpointStatus (line 351) | pub enum EndpointStatus {
  method fmt (line 359) | fn fmt(&self, writer: &mut std::fmt::Formatter) -> std::fmt::Result {
  type EndpointTerminateMode (line 370) | pub enum EndpointTerminateMode {
    method fmt (line 381) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type EndpointStartArgs (line 390) | pub struct EndpointStartArgs {
  function local_pageserver_conf_to_conn_info (line 1222) | pub fn local_pageserver_conf_to_conn_info(
  function tenant_locate_response_to_conn_info (line 1258) | pub fn tenant_locate_response_to_conn_info(

FILE: control_plane/src/endpoint_storage.rs
  constant ENDPOINT_STORAGE_REMOTE_STORAGE_DIR (line 10) | pub const ENDPOINT_STORAGE_REMOTE_STORAGE_DIR: &str = "local_fs_remote_s...
  constant ENDPOINT_STORAGE_DEFAULT_ADDR (line 11) | pub const ENDPOINT_STORAGE_DEFAULT_ADDR: SocketAddr =
  type EndpointStorage (line 14) | pub struct EndpointStorage {
    method from_env (line 22) | pub fn from_env(env: &LocalEnv) -> EndpointStorage {
    method config_path (line 31) | fn config_path(&self) -> Utf8PathBuf {
    method listen_addr (line 35) | fn listen_addr(&self) -> Utf8PathBuf {
    method init (line 39) | pub fn init(&self) -> Result<()> {
    method start (line 62) | pub async fn start(&self, retry_timeout: &Duration) -> Result<()> {
    method stop (line 92) | pub fn stop(&self, immediate: bool) -> anyhow::Result<()> {
    method log_file (line 96) | fn log_file(&self) -> Utf8PathBuf {
    method pid_file (line 100) | fn pid_file(&self) -> Utf8PathBuf {

FILE: control_plane/src/local_env.rs
  constant DEFAULT_PG_VERSION (line 31) | pub const DEFAULT_PG_VERSION: u32 = 17;
  type LocalEnv (line 41) | pub struct LocalEnv {
    method pg_distrib_dir_raw (line 432) | pub fn pg_distrib_dir_raw(&self) -> PathBuf {
    method pg_distrib_dir (line 436) | pub fn pg_distrib_dir(&self, pg_version: PgMajorVersion) -> anyhow::Re...
    method pg_dir (line 442) | pub fn pg_dir(&self, pg_version: PgMajorVersion, dir_name: &str) -> an...
    method pg_bin_dir (line 446) | pub fn pg_bin_dir(&self, pg_version: PgMajorVersion) -> anyhow::Result...
    method pg_lib_dir (line 450) | pub fn pg_lib_dir(&self, pg_version: PgMajorVersion) -> anyhow::Result...
    method endpoint_storage_bin (line 454) | pub fn endpoint_storage_bin(&self) -> PathBuf {
    method pageserver_bin (line 458) | pub fn pageserver_bin(&self) -> PathBuf {
    method storage_controller_bin (line 462) | pub fn storage_controller_bin(&self) -> PathBuf {
    method safekeeper_bin (line 470) | pub fn safekeeper_bin(&self) -> PathBuf {
    method storage_broker_bin (line 474) | pub fn storage_broker_bin(&self) -> PathBuf {
    method endpoints_path (line 478) | pub fn endpoints_path(&self) -> PathBuf {
    method storage_broker_data_dir (line 482) | pub fn storage_broker_data_dir(&self) -> PathBuf {
    method pageserver_data_dir (line 486) | pub fn pageserver_data_dir(&self, pageserver_id: NodeId) -> PathBuf {
    method safekeeper_data_dir (line 491) | pub fn safekeeper_data_dir(&self, data_dir_name: &str) -> PathBuf {
    method endpoint_storage_data_dir (line 495) | pub fn endpoint_storage_data_dir(&self) -> PathBuf {
    method get_pageserver_conf (line 499) | pub fn get_pageserver_conf(&self, id: NodeId) -> anyhow::Result<&PageS...
    method ssl_ca_cert_path (line 513) | pub fn ssl_ca_cert_path(&self) -> Option<PathBuf> {
    method ssl_ca_key_path (line 521) | pub fn ssl_ca_key_path(&self) -> Option<PathBuf> {
    method generate_ssl_ca_cert (line 529) | pub fn generate_ssl_ca_cert(&self) -> anyhow::Result<()> {
    method generate_ssl_cert (line 538) | pub fn generate_ssl_cert(&self, cert_path: &Path, key_path: &Path) -> ...
    method create_http_client (line 549) | pub fn create_http_client(&self) -> reqwest::Client {
    method storage_controller_instances (line 567) | pub async fn storage_controller_instances(&self) -> std::io::Result<Ve...
    method register_branch_mapping (line 595) | pub fn register_branch_mapping(
    method get_branch_timeline_id (line 624) | pub fn get_branch_timeline_id(
    method timeline_name_mappings (line 636) | pub fn timeline_name_mappings(&self) -> HashMap<TenantTimelineId, Stri...
    method load_config (line 648) | pub fn load_config(repopath: &Path) -> anyhow::Result<Self> {
    method persist_config (line 792) | pub fn persist_config(&self) -> anyhow::Result<()> {
    method persist_config_impl (line 815) | pub fn persist_config_impl(base_path: &Path, config: &OnDiskConfig) ->...
    method generate_auth_token (line 827) | pub fn generate_auth_token<S: Serialize>(&self, claims: &S) -> anyhow:...
    method get_private_key_path (line 833) | pub fn get_private_key_path(&self) -> PathBuf {
    method get_public_key_path (line 842) | pub fn get_public_key_path(&self) -> PathBuf {
    method read_private_key (line 851) | pub fn read_private_key(&self) -> anyhow::Result<Pem> {
    method read_public_key (line 858) | pub fn read_public_key(&self) -> anyhow::Result<Pem> {
    method init (line 865) | pub fn init(conf: NeonLocalInitConf, force: &InitForceMode) -> anyhow:...
  type OnDiskConfig (line 104) | pub struct OnDiskConfig {
  function fail_if_pageservers_field_specified (line 129) | fn fail_if_pageservers_field_specified<'de, D>(_: D) -> Result<Vec<PageS...
  type NeonLocalInitConf (line 142) | pub struct NeonLocalInitConf {
  type EndpointStorageConf (line 160) | pub struct EndpointStorageConf {
  type NeonBroker (line 167) | pub struct NeonBroker {
    method client_url (line 270) | pub fn client_url(&self) -> Url {
  type NeonStorageControllerConf (line 180) | pub struct NeonStorageControllerConf {
    constant DEFAULT_MAX_OFFLINE_INTERVAL (line 227) | const DEFAULT_MAX_OFFLINE_INTERVAL: std::time::Duration = std::time::D...
    constant DEFAULT_MAX_WARMING_UP_INTERVAL (line 229) | const DEFAULT_MAX_WARMING_UP_INTERVAL: std::time::Duration = std::time...
    constant DEFAULT_HEARTBEAT_INTERVAL (line 232) | const DEFAULT_HEARTBEAT_INTERVAL: std::time::Duration = std::time::Dur...
  method default (line 236) | fn default() -> Self {
  method default (line 262) | fn default() -> Self {
  type PageServerConf (line 291) | pub struct PageServerConf {
    method from (line 339) | fn from(conf: &NeonLocalInitPageserverConf) -> Self {
  method default (line 304) | fn default() -> Self {
  type NeonLocalInitPageserverConf (line 323) | pub struct NeonLocalInitPageserverConf {
  type SafekeeperConf (line 368) | pub struct SafekeeperConf {
    method get_compute_port (line 426) | pub fn get_compute_port(&self) -> u16 {
  method default (line 382) | fn default() -> Self {
  type InitForceMode (line 399) | pub enum InitForceMode {
  method value_variants (line 406) | fn value_variants<'a>() -> &'a [Self] {
  method to_possible_value (line 414) | fn to_possible_value(&self) -> Option<clap::builder::PossibleValue> {
  function base_path (line 1015) | pub fn base_path() -> PathBuf {
  function generate_auth_keys (line 1038) | fn generate_auth_keys(private_key_path: &Path, public_key_path: &Path) -...
  function generate_ssl_ca_cert (line 1076) | fn generate_ssl_ca_cert(cert_path: &Path, key_path: &Path) -> anyhow::Re...
  function generate_ssl_cert (line 1097) | fn generate_ssl_cert(

FILE: control_plane/src/pageserver.rs
  constant PAGESERVER_REMOTE_STORAGE_DIR (line 34) | pub const PAGESERVER_REMOTE_STORAGE_DIR: &str = "local_fs_remote_storage...
  type PageServerNode (line 42) | pub struct PageServerNode {
    method from_env (line 50) | pub fn from_env(env: &LocalEnv, conf: &PageServerConf) -> PageServerNo...
    method pageserver_make_identity_toml (line 87) | fn pageserver_make_identity_toml(&self, node_id: NodeId) -> toml_edit:...
    method pageserver_init_make_toml (line 91) | fn pageserver_init_make_toml(
    method initialize (line 169) | pub fn initialize(&self, conf: NeonLocalInitPageserverConf) -> anyhow:...
    method repo_path (line 174) | pub fn repo_path(&self) -> PathBuf {
    method pid_file (line 181) | fn pid_file(&self) -> Utf8PathBuf {
    method start (line 186) | pub async fn start(&self, retry_timeout: &Duration) -> anyhow::Result<...
    method pageserver_init (line 190) | fn pageserver_init(&self, conf: NeonLocalInitPageserverConf) -> anyhow...
    method start_node (line 303) | async fn start_node(&self, retry_timeout: &Duration) -> anyhow::Result...
    method pageserver_env_variables (line 345) | fn pageserver_env_variables(&self) -> anyhow::Result<Vec<(String, Stri...
    method stop (line 368) | pub fn stop(&self, immediate: bool) -> anyhow::Result<()> {
    method check_status (line 372) | pub async fn check_status(&self) -> mgmt_api::Result<()> {
    method tenant_list (line 376) | pub async fn tenant_list(&self) -> mgmt_api::Result<Vec<TenantInfo>> {
    method parse_config (line 379) | pub fn parse_config(mut settings: HashMap<&str, &str>) -> anyhow::Resu...
    method tenant_config (line 582) | pub async fn tenant_config(
    method timeline_list (line 595) | pub async fn timeline_list(
    method timeline_import (line 611) | pub async fn timeline_import(
    method timeline_info (line 656) | pub async fn timeline_info(

FILE: control_plane/src/postgresql_conf.rs
  type PostgresConf (line 15) | pub struct PostgresConf {
    method new (line 21) | pub fn new() -> PostgresConf {
    method get (line 26) | pub fn get(&self, option: &str) -> Option<&str> {
    method append (line 35) | pub fn append(&mut self, option: &str, value: &str) {
    method append_line (line 42) | pub fn append_line(&mut self, line: &str) {
    method fmt (line 49) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  function escape_str (line 58) | fn escape_str(s: &str) -> String {
  function test_postgresql_conf_escapes (line 88) | fn test_postgresql_conf_escapes() -> anyhow::Result<()> {

FILE: control_plane/src/safekeeper.rs
  type SafekeeperHttpError (line 27) | pub enum SafekeeperHttpError {
  type Result (line 35) | type Result<T> = result::Result<T, SafekeeperHttpError>;
  function err_from_client_err (line 37) | fn err_from_client_err(err: mgmt_api::Error) -> SafekeeperHttpError {
  type SafekeeperNode (line 54) | pub struct SafekeeperNode {
    method from_env (line 66) | pub fn from_env(env: &LocalEnv, conf: &SafekeeperConf) -> SafekeeperNo...
    method safekeeper_connection_config (line 85) | fn safekeeper_connection_config(addr: &str, port: u16) -> PgConnection...
    method datadir_path_by_id (line 89) | pub fn datadir_path_by_id(env: &LocalEnv, sk_id: NodeId) -> PathBuf {
    method datadir_path (line 93) | pub fn datadir_path(&self) -> PathBuf {
    method pid_file (line 97) | pub fn pid_file(&self) -> Utf8PathBuf {
    method initialize (line 104) | pub fn initialize(&self) -> anyhow::Result<()> {
    method start (line 125) | pub async fn start(
    method stop (line 261) | pub fn stop(&self, immediate: bool) -> anyhow::Result<()> {
    method check_status (line 269) | pub async fn check_status(&self) -> Result<()> {
    method create_timeline (line 277) | pub async fn create_timeline(&self, req: &TimelineCreateRequest) -> Re...

FILE: control_plane/src/storage_controller.rs
  type StorageController (line 37) | pub struct StorageController {
    method from_env (line 112) | pub fn from_env(env: &LocalEnv) -> Self {
    method storage_controller_instance_dir (line 169) | fn storage_controller_instance_dir(&self, instance_id: u8) -> PathBuf {
    method pid_file (line 175) | fn pid_file(&self, instance_id: u8) -> Utf8PathBuf {
    method get_pg_dir (line 188) | async fn get_pg_dir(&self, dir_name: &str) -> anyhow::Result<Utf8PathB...
    method get_pg_bin_dir (line 212) | pub async fn get_pg_bin_dir(&self) -> anyhow::Result<Utf8PathBuf> {
    method get_pg_lib_dir (line 216) | pub async fn get_pg_lib_dir(&self) -> anyhow::Result<Utf8PathBuf> {
    method pg_isready (line 221) | async fn pg_isready(&self, pg_bin_dir: &Utf8Path, postgres_port: u16) ...
    method setup_database (line 255) | pub async fn setup_database(&self, postgres_port: u16) -> anyhow::Resu...
    method connect_to_database (line 298) | pub async fn connect_to_database(
    method pg_ctl (line 324) | async fn pg_ctl<I, S>(&self, args: I) -> ExitStatus
    method start (line 348) | pub async fn start(&self, start_args: NeonStorageControllerStartArgs) ...
    method stop (line 702) | pub async fn stop(&self, stop_args: NeonStorageControllerStopArgs) -> ...
    method is_postgres_running (line 755) | async fn is_postgres_running(&self) -> anyhow::Result<bool> {
    method get_claims_for_path (line 778) | fn get_claims_for_path(path: &str) -> anyhow::Result<Option<Claims>> {
    method dispatch (line 793) | async fn dispatch<RQ, RS>(
    method dispatch_inner (line 811) | async fn dispatch_inner<RQ>(
    method register_safekeepers (line 866) | async fn register_safekeepers(&self) -> anyhow::Result<()> {
    method attach_hook (line 890) | pub async fn attach_hook(
    method upsert_safekeeper (line 914) | pub async fn upsert_safekeeper(
    method safekeeper_scheduling_policy (line 936) | pub async fn safekeeper_scheduling_policy(
    method inspect (line 950) | pub async fn inspect(
    method tenant_create (line 968) | pub async fn tenant_create(
    method tenant_import (line 977) | pub async fn tenant_import(&self, tenant_id: TenantId) -> anyhow::Resu...
    method tenant_locate (line 987) | pub async fn tenant_locate(&self, tenant_id: TenantId) -> anyhow::Resu...
    method node_register (line 997) | pub async fn node_register(&self, req: NodeRegisterRequest) -> anyhow:...
    method node_configure (line 1003) | pub async fn node_configure(&self, req: NodeConfigureRequest) -> anyho...
    method node_list (line 1012) | pub async fn node_list(&self) -> anyhow::Result<Vec<NodeDescribeRespon...
    method ready (line 1022) | pub async fn ready(&self) -> anyhow::Result<()> {
    method tenant_timeline_create (line 1028) | pub async fn tenant_timeline_create(
    method set_tenant_config (line 1041) | pub async fn set_tenant_config(&self, req: &TenantConfigRequest) -> an...
  constant COMMAND (line 49) | const COMMAND: &str = "storage_controller";
  constant STORAGE_CONTROLLER_POSTGRES_VERSION (line 51) | const STORAGE_CONTROLLER_POSTGRES_VERSION: PgMajorVersion = PgMajorVersi...
  constant DB_NAME (line 53) | const DB_NAME: &str = "storage_controller";
  type NeonStorageControllerStartArgs (line 55) | pub struct NeonStorageControllerStartArgs {
    method with_default_instance_id (line 63) | pub fn with_default_instance_id(start_timeout: humantime::Duration) ->...
  type NeonStorageControllerStopArgs (line 73) | pub struct NeonStorageControllerStopArgs {
    method with_default_instance_id (line 79) | pub fn with_default_instance_id(immediate: bool) -> Self {
  type AttachHookRequest (line 88) | pub struct AttachHookRequest {
  type AttachHookResponse (line 96) | pub struct AttachHookResponse {
  type InspectRequest (line 102) | pub struct InspectRequest {
  type InspectResponse (line 107) | pub struct InspectResponse {

FILE: control_plane/storcon_cli/src/main.rs
  type Command (line 29) | enum Command {
  type Cli (line 323) | struct Cli {
  type PlacementPolicyArg (line 343) | struct PlacementPolicyArg(PlacementPolicy);
  type Err (line 346) | type Err = anyhow::Error;
  method from_str (line 348) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  type SkSchedulingPolicyArg (line 370) | struct SkSchedulingPolicyArg(SkSchedulingPolicy);
  type Err (line 373) | type Err = anyhow::Error;
  method from_str (line 375) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  type ShardSchedulingPolicyArg (line 381) | struct ShardSchedulingPolicyArg(ShardSchedulingPolicy);
  type Err (line 384) | type Err = anyhow::Error;
  method from_str (line 386) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  type NodeAvailabilityArg (line 400) | struct NodeAvailabilityArg(NodeAvailabilityWrapper);
  type Err (line 403) | type Err = anyhow::Error;
  method from_str (line 405) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  function wait_for_scheduling_policy (line 414) | async fn wait_for_scheduling_policy<F>(
  function main (line 443) | async fn main() -> anyhow::Result<()> {
  function watch_tenant_shard (line 1424) | async fn watch_tenant_shard(

FILE: docker-compose/ext-src/pgx_ulid-src/sql/01_ulid_conversions.sql
  type test_ulids (line 2) | CREATE TEMP TABLE test_ulids AS

FILE: docker-compose/ext-src/postgis-src/raster_outdb_template.sql
  type public (line 23) | CREATE TABLE public.raster_outdb_template (

FILE: endpoint_storage/src/app.rs
  function app (line 13) | pub fn app(state: Arc<Storage>) -> Router<()> {
  type Result (line 34) | type Result = anyhow::Result<Response, Response>;
  type State (line 35) | type State = axum::extract::State<Arc<Storage>>;
  constant CONTENT_TYPE (line 37) | const CONTENT_TYPE: &str = "content-type";
  constant APPLICATION_OCTET_STREAM (line 38) | const APPLICATION_OCTET_STREAM: &str = "application/octet-stream";
  constant WARN_THRESHOLD (line 39) | const WARN_THRESHOLD: u32 = 3;
  constant MAX_RETRIES (line 40) | const MAX_RETRIES: u32 = 10;
  function metrics (line 42) | async fn metrics() -> Result {
  function get (line 49) | async fn get(S3Path { path }: S3Path, state: State) -> Result {
  function set (line 87) | async fn set(S3Path { path }: S3Path, state: State, bytes: Bytes) -> Res...
  function delete (line 120) | async fn delete(S3Path { path }: S3Path, state: State) -> Result {
  function delete_prefix (line 137) | async fn delete_prefix(PrefixS3Path { path }: PrefixS3Path, state: State...
  function check_storage_permissions (line 154) | pub async fn check_storage_permissions(
  function bytes_to_stream (line 199) | fn bytes_to_stream(bytes: Bytes) -> impl futures::Stream<Item = std::io:...
  constant REAL_S3_ENV (line 217) | const REAL_S3_ENV: &str = "ENABLE_REAL_S3_REMOTE_STORAGE";
  constant REAL_S3_BUCKET (line 218) | const REAL_S3_BUCKET: &str = "REMOTE_STORAGE_S3_BUCKET";
  constant REAL_S3_REGION (line 219) | const REAL_S3_REGION: &str = "REMOTE_STORAGE_S3_REGION";
  function proxy (line 221) | async fn proxy() -> (Storage, Option<camino_tempfile::Utf8TempDir>) {
  constant TEST_PUB_KEY_ED25519 (line 266) | const TEST_PUB_KEY_ED25519: &[u8] = b"
  constant TEST_PRIV_KEY_ED25519 (line 272) | const TEST_PRIV_KEY_ED25519: &[u8] = br#"
  function request (line 278) | async fn request(req: Request<Body>) -> Response<Body> {
  function status (line 288) | async fn status() {
  function routes (line 298) | fn routes() -> impl Iterator<Item = (&'static str, &'static str)> {
  function no_token (line 306) | async fn no_token() {
  function invalid_token (line 324) | async fn invalid_token() {
  constant TENANT_ID (line 342) | const TENANT_ID: TenantId =
  constant TIMELINE_ID (line 344) | const TIMELINE_ID: TimelineId =
  constant ENDPOINT_ID (line 346) | const ENDPOINT_ID: &str = "ep-winter-frost-a662z3vg";
  function token (line 347) | fn token() -> String {
  function unauthorized (line 360) | async fn unauthorized() {
  function method_not_allowed (line 394) | async fn method_not_allowed() {
  function requests_chain (line 414) | async fn requests_chain(
  function metrics (line 445) | async fn metrics() {
  function insert_retrieve_remove (line 473) | async fn insert_retrieve_remove() {
  function read_other_endpoint_data (line 486) | async fn read_other_endpoint_data() {
  function delete_prefix_token (line 495) | fn delete_prefix_token(uri: &str) -> String {
  function delete_prefix (line 510) | async fn delete_prefix() {

FILE: endpoint_storage/src/claims.rs
  type EndpointStorageClaims (line 7) | pub struct EndpointStorageClaims {
  type DeletePrefixClaims (line 16) | pub struct DeletePrefixClaims {
  method fmt (line 26) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  method fmt (line 36) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

FILE: endpoint_storage/src/lib.rs
  type JwtAuth (line 21) | pub struct JwtAuth {
    method new (line 28) | pub fn new(key: &[u8]) -> Result<Self> {
    method decode (line 35) | pub fn decode<T: serde::de::DeserializeOwned>(&self, token: &str) -> R...
  constant VALIDATION_ALGO (line 26) | pub const VALIDATION_ALGO: jsonwebtoken::Algorithm = jsonwebtoken::Algor...
  function normalize_key (line 40) | fn normalize_key(key: &str) -> StdResult<Utf8PathBuf, String> {
  function clean_utf8 (line 52) | fn clean_utf8(path: &camino::Utf8Path) -> Utf8PathBuf {
  type Storage (line 77) | pub struct Storage {
  type KeyRequest (line 85) | struct KeyRequest {
  type PrefixKeyRequest (line 93) | struct PrefixKeyRequest {
  type S3Path (line 100) | pub struct S3Path {
    type Error (line 105) | type Error = String;
    method try_from (line 106) | fn try_from(req: &KeyRequest) -> StdResult<Self, Self::Error> {
    type Rejection (line 144) | type Rejection = Response;
    method from_request_parts (line 145) | async fn from_request_parts(
  function unauthorized (line 120) | fn unauthorized(route: impl Display, claims: impl Display) -> Response {
  function bad_request (line 125) | pub fn bad_request(err: impl Display, desc: &'static str) -> Response {
  function ok (line 130) | pub fn ok() -> Response {
  function internal_error (line 134) | pub fn internal_error(err: impl Display, path: impl Display, desc: &'sta...
  function not_found (line 139) | pub fn not_found(key: impl ToString) -> Response {
  type PrefixS3Path (line 186) | pub struct PrefixS3Path {
    method from (line 191) | fn from(path: &DeletePrefixClaims) -> Self {
    type Rejection (line 211) | type Rejection = Response;
    method from_request_parts (line 212) | async fn from_request_parts(
  function normalize_key (line 246) | fn normalize_key() {
  constant TENANT_ID (line 262) | const TENANT_ID: TenantId =
  constant TIMELINE_ID (line 264) | const TIMELINE_ID: TimelineId =
  constant ENDPOINT_ID (line 266) | const ENDPOINT_ID: &str = "ep-winter-frost-a662z3vg";
  function s3_path (line 269) | fn s3_path() {
  function prefix_s3_path (line 299) | fn prefix_s3_path() {

FILE: endpoint_storage/src/main.rs
  function max_upload_file_limit (line 13) | const fn max_upload_file_limit() -> usize {
  function listen (line 17) | const fn listen() -> SocketAddr {
  type Args (line 22) | struct Args {
  type Config (line 34) | struct Config {
  function main (line 45) | async fn main() -> anyhow::Result<()> {

FILE: libs/compute_api/src/privilege.rs
  type Privilege (line 3) | pub enum Privilege {
    method as_str (line 19) | pub fn as_str(&self) -> &'static str {

FILE: libs/compute_api/src/requests.rs
  type ComputeClaimsScope (line 16) | pub enum ComputeClaimsScope {
  type Err (line 24) | type Err = anyhow::Error;
  method from_str (line 26) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  type ComputeClaims (line 39) | pub struct ComputeClaims {
  type ConfigurationRequest (line 65) | pub struct ConfigurationRequest {
  type ExtensionInstallRequest (line 71) | pub struct ExtensionInstallRequest {
  type SetRoleGrantsRequest (line 78) | pub struct SetRoleGrantsRequest {
  function compute_request_scopes (line 94) | fn compute_request_scopes() {

FILE: libs/compute_api/src/responses.rs
  type GenericAPIError (line 12) | pub struct GenericAPIError {
  type ComputeConfig (line 24) | pub struct ComputeConfig {
    method from (line 34) | fn from(value: ControlPlaneConfigResponse) -> Self {
  type ExtensionInstallResponse (line 43) | pub struct ExtensionInstallResponse {
  type LfcPrewarmState (line 53) | pub enum LfcPrewarmState {
  method fmt (line 89) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type LfcOffloadState (line 103) | pub enum LfcOffloadState {
  type PromoteState (line 121) | pub enum PromoteState {
  type PromoteConfig (line 135) | pub struct PromoteConfig {
  type ComputeStatusResponse (line 143) | pub struct ComputeStatusResponse {
  type TerminateMode (line 155) | pub enum TerminateMode {
  type ComputeStatus (line 174) | pub enum ComputeStatus {
    method from (line 164) | fn from(mode: TerminateMode) -> Self {
  type TerminateResponse (line 205) | pub struct TerminateResponse {
  method fmt (line 210) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function rfc3339_serialize (line 231) | pub fn rfc3339_serialize<S>(x: &Option<DateTime<Utc>>, s: S) -> Result<S...
  type ComputeMetrics (line 244) | pub struct ComputeMetrics {
  type CatalogObjects (line 287) | pub struct CatalogObjects {
  type ComputeCtlConfig (line 293) | pub struct ComputeCtlConfig {
  method default (line 301) | fn default() -> Self {
  type TlsConfig (line 312) | pub struct TlsConfig {
  type ControlPlaneConfigResponse (line 319) | pub struct ControlPlaneConfigResponse {
  type ControlPlaneComputeStatus (line 327) | pub enum ControlPlaneComputeStatus {
  type InstalledExtension (line 337) | pub struct InstalledExtension {
  type InstalledExtensions (line 345) | pub struct InstalledExtensions {
  type ExtensionInstallResult (line 350) | pub struct ExtensionInstallResult {
  type SetRoleGrantsResponse (line 355) | pub struct SetRoleGrantsResponse {

FILE: libs/compute_api/src/spec.rs
  type PgIdent (line 23) | pub type PgIdent = String;
  type ExtVersion (line 26) | pub type ExtVersion = String;
  function default_reconfigure_concurrency (line 28) | fn default_reconfigure_concurrency() -> usize {
  type ComputeSpec (line 35) | pub struct ComputeSpec {
  type ComputeFeature (line 220) | pub enum ComputeFeature {
  type PageserverConnectionInfo (line 237) | pub struct PageserverConnectionInfo {
    method from_connstr (line 260) | pub fn from_connstr(
    method shard_url (line 322) | pub fn shard_url(
  type PageserverShardInfo (line 359) | pub struct PageserverShardInfo {
  type PageserverShardConnectionInfo (line 364) | pub struct PageserverShardConnectionInfo {
  type RemoteExtSpec (line 371) | pub struct RemoteExtSpec {
    method get_ext (line 385) | pub fn get_ext(
    method get_arch (line 434) | fn get_arch() -> &'static str {
    method build_remote_path (line 443) | fn build_remote_path(
  type ExtensionData (line 379) | pub struct ExtensionData {
  type ComputeMode (line 462) | pub enum ComputeMode {
    method to_type_str (line 478) | pub fn to_type_str(&self) -> &'static str {
  method fmt (line 488) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type ComputeAudit (line 495) | pub enum ComputeAudit {
  type Cluster (line 516) | pub struct Cluster {
  type DeltaOp (line 538) | pub struct DeltaOp {
  type Role (line 547) | pub struct Role {
  type Database (line 556) | pub struct Database {
  type GenericOption (line 572) | pub struct GenericOption {
  type PgComputeTlsSettings (line 580) | pub struct PgComputeTlsSettings {
  type DatabricksSettings (line 593) | pub struct DatabricksSettings {
  type GenericOptions (line 606) | pub type GenericOptions = Option<Vec<GenericOption>>;
  type LocalProxySpec (line 611) | pub struct LocalProxySpec {
  type JwksSettings (line 621) | pub struct JwksSettings {
  type PageserverProtocol (line 631) | pub enum PageserverProtocol {
    method from_connstring (line 644) | pub fn from_connstring(connstring: &str) -> anyhow::Result<Self> {
    method scheme (line 658) | pub fn scheme(&self) -> &'static str {
  method fmt (line 667) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function allow_installing_remote_extensions (line 679) | fn allow_installing_remote_extensions() {
  function remote_extension_path (line 775) | fn remote_extension_path() {
  function parse_spec_file (line 806) | fn parse_spec_file() {
  function parse_unknown_fields (line 818) | fn parse_unknown_fields() {
  function parse_unknown_features (line 828) | fn parse_unknown_features() {
  function parse_known_features (line 846) | fn parse_known_features() {

FILE: libs/consumption_metrics/src/lib.rs
  type EventType (line 10) | pub enum EventType {
    method absolute_time (line 21) | pub fn absolute_time(&self) -> Option<&DateTime<Utc>> {
    method incremental_timerange (line 29) | pub fn incremental_timerange(&self) -> Option<std::ops::Range<&DateTim...
    method is_incremental (line 42) | pub fn is_incremental(&self) -> bool {
    method recorded_at (line 47) | pub fn recorded_at(&self) -> &DateTime<Utc> {
  type Event (line 58) | pub struct Event<Extra, Metric> {
  function idempotency_key (line 71) | pub fn idempotency_key(node_id: &str) -> String {
  type IdempotencyKey (line 76) | pub struct IdempotencyKey<'a> {
  function fmt (line 83) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function generate (line 89) | pub fn generate(node_id: &'a str) -> Self {
  function for_tests (line 97) | pub fn for_tests(now: DateTime<Utc>, node_id: &'a str, nonce: u16) -> Se...
  constant CHUNK_SIZE (line 107) | pub const CHUNK_SIZE: usize = 1000;
  type EventChunk (line 112) | pub struct EventChunk<'a, T: Clone + PartialEq> {

FILE: libs/desim/src/chan.rs
  type Chan (line 10) | pub struct Chan<T> {
  method clone (line 15) | fn clone(&self) -> Self {
  method default (line 23) | fn default() -> Self {
  function new (line 29) | pub fn new() -> Chan<T> {
  function recv (line 40) | pub fn recv(&self) -> T {
  function must_recv (line 45) | pub fn must_recv(&self) -> T {
  function try_recv (line 53) | pub fn try_recv(&self) -> Option<T> {
  function send (line 58) | pub fn send(&self, t: T) {
  type State (line 63) | struct State<T> {
  function send (line 69) | fn send(&self, t: T) {
  function try_recv (line 74) | fn try_recv(&self) -> Option<T> {
  function recv (line 79) | fn recv(&self) -> T {
  method wake_me (line 101) | fn wake_me(&self) {
  method has_some (line 106) | fn has_some(&self) -> bool {

FILE: libs/desim/src/executor.rs
  type Runtime (line 12) | pub struct Runtime {
    method new (line 27) | pub fn new(clock: Arc<Timing>) -> Self {
    method spawn (line 37) | pub fn spawn<F>(&mut self, f: F) -> ExternalHandle
    method step (line 94) | pub fn step(&mut self) -> bool {
    method crash_all_threads (line 145) | pub fn crash_all_threads(&mut self) {
  method drop (line 158) | fn drop(&mut self) {
  type ExternalHandle (line 165) | pub struct ExternalHandle {
    method is_finished (line 171) | pub fn is_finished(&self) -> bool {
    method result (line 177) | pub fn result(&self) -> (i32, String) {
    method id (line 183) | pub fn id(&self) -> u32 {
    method crash_stop (line 188) | pub fn crash_stop(&self) {
  type ThreadHandle (line 193) | struct ThreadHandle {
    method new (line 200) | fn new(ctx: Arc<ThreadContext>, join: JoinHandle<()>) -> Self {
    method step (line 213) | fn step(&self) -> Status {
  type Status (line 229) | enum Status {
  constant NO_WAKEUP (line 238) | const NO_WAKEUP: u8 = 0;
  constant PENDING_WAKEUP (line 239) | const PENDING_WAKEUP: u8 = 1;
  type ThreadContext (line 241) | pub struct ThreadContext {
    method new (line 258) | pub(crate) fn new() -> Self {
    method inc_wake (line 275) | fn inc_wake(&self) {
    method schedule_wakeup (line 280) | pub(crate) fn schedule_wakeup(self: &Arc<Self>, after_ms: u64) {
    method tid (line 287) | fn tid(&self) -> u32 {
    method crash_stop (line 291) | fn crash_stop(&self) {
    method yield_me (line 317) | fn yield_me(self: &Arc<Self>, after_ms: i64) {
    method finish_me (line 352) | fn finish_me(&self) {
  function with_thread_context (line 369) | fn with_thread_context<T>(f: impl FnOnce(&Arc<ThreadContext>) -> T) -> T {
  type Waker (line 377) | pub struct Waker {
    method new (line 389) | pub fn new() -> Self {
    method wake_me_later (line 396) | pub fn wake_me_later(&self) {
    method wake_all (line 403) | pub fn wake_all(&self) {
  method default (line 383) | fn default() -> Self {
  function yield_me (line 413) | pub fn yield_me(after_ms: i64) {
  function now (line 418) | pub fn now() -> u64 {
  function exit (line 422) | pub fn exit(code: i32, msg: String) -> ! {
  function get_thread_ctx (line 431) | pub(crate) fn get_thread_ctx() -> Arc<ThreadContext> {
  type PollSome (line 436) | pub trait PollSome {
    method wake_me (line 438) | fn wake_me(&self);
    method has_some (line 441) | fn has_some(&self) -> bool;
  function epoll_chans (line 449) | pub fn epoll_chans(chans: &[Box<dyn PollSome>], timeout: i64) -> Option<...

FILE: libs/desim/src/network.rs
  type NetworkTask (line 18) | pub struct NetworkTask {
    method start_new (line 27) | pub fn start_new(options: Arc<NetworkOptions>, tx: mpsc::Sender<Arc<Ne...
    method start_new_connection (line 43) | pub fn start_new_connection(self: &Arc<Self>, rng: StdRng, dst_accept:...
    method schedule (line 75) | fn schedule(&self, id: usize, after_ms: u64) {
    method get (line 84) | fn get(&self, id: usize) -> MappedMutexGuard<'_, RawMutex, VirtualConn...
    method collect_pending_events (line 90) | fn collect_pending_events(&self, now: u64, vec: &mut Vec<Event>) {
    method start (line 102) | fn start(self: &Arc<Self>) {
  type MessageDirection (line 123) | type MessageDirection = u8;
  function sender_str (line 125) | fn sender_str(dir: MessageDirection) -> &'static str {
  function receiver_str (line 133) | fn receiver_str(dir: MessageDirection) -> &'static str {
  type VirtualConnection (line 144) | struct VirtualConnection {
    method schedule_timeout (line 160) | fn schedule_timeout(&self, net: &NetworkTask) {
    method send_connect (line 167) | fn send_connect(&self, net: &NetworkTask) {
    method process (line 193) | fn process(&self, net: &Arc<NetworkTask>) {
    method process_direction (line 240) | fn process_direction(
    method send (line 277) | fn send(&self, net: &NetworkTask, direction: MessageDirection, msg: An...
    method close (line 320) | fn close(&self, node_idx: usize) {
  type ConnectionState (line 153) | struct ConnectionState {
  type NetworkBuffer (line 355) | struct NetworkBuffer {
    method new (line 372) | fn new(last_recv: Option<u64>) -> Self {
  type TCP (line 384) | pub struct TCP {
    method send (line 400) | pub fn send(&self, msg: AnyMessage) {
    method recv_chan (line 406) | pub fn recv_chan(&self) -> Chan<NetEvent> {
    method connection_id (line 410) | pub fn connection_id(&self) -> usize {
    method close (line 414) | pub fn close(&self) {
  method fmt (line 392) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Event (line 419) | struct Event {
  method partial_cmp (line 427) | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
  method cmp (line 433) | fn cmp(&self, other: &Self) -> Ordering {
  method eq (line 439) | fn eq(&self, other: &Self) -> bool {

FILE: libs/desim/src/node_os.rs
  type NodeOs (line 12) | pub struct NodeOs {
    method new (line 18) | pub fn new(world: Arc<World>, internal: Arc<Node>) -> NodeOs {
    method id (line 23) | pub fn id(&self) -> NodeId {
    method open_tcp (line 28) | pub fn open_tcp(&self, dst: NodeId) -> TCP {
    method node_events (line 33) | pub fn node_events(&self) -> Chan<NodeEvent> {
    method now (line 38) | pub fn now(&self) -> u64 {
    method random (line 43) | pub fn random(&self, max: u64) -> u64 {
    method log_event (line 48) | pub fn log_event(&self, data: String) {

FILE: libs/desim/src/options.rs
  type Delay (line 7) | pub struct Delay {
    method empty (line 15) | pub fn empty() -> Delay {
    method fixed (line 24) | pub fn fixed(ms: u64) -> Delay {
    method delay (line 34) | pub fn delay(&self, rng: &mut StdRng) -> Option<u64> {
  type NetworkOptions (line 44) | pub struct NetworkOptions {

FILE: libs/desim/src/proto.rs
  type NodeEvent (line 11) | pub enum NodeEvent {
  type NetEvent (line 18) | pub enum NetEvent {
  type SimEvent (line 25) | pub struct SimEvent {
  type AnyMessage (line 34) | pub enum AnyMessage {
  method fmt (line 46) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type ReplCell (line 60) | pub struct ReplCell {

FILE: libs/desim/src/time.rs
  type Timing (line 13) | pub struct Timing {
    method new (line 33) | pub fn new() -> Timing {
    method now (line 43) | pub fn now(&self) -> u64 {
    method step (line 49) | pub(crate) fn step(&self) -> Option<Arc<ThreadContext>> {
    method schedule_wakeup (line 69) | pub(crate) fn schedule_wakeup(&self, ms: u64, wake_context: Arc<Thread...
    method schedule_fake (line 80) | pub fn schedule_fake(&self, ms: u64) {
    method is_event_ready (line 89) | fn is_event_ready(&self, queue: &mut BinaryHeap<Pending>) -> bool {
    method clear (line 94) | pub(crate) fn clear(&self) {
  method default (line 26) | fn default() -> Self {
  type Pending (line 99) | struct Pending {
  method partial_cmp (line 108) | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
  method cmp (line 114) | fn cmp(&self, other: &Self) -> Ordering {
  method eq (line 120) | fn eq(&self, other: &Self) -> bool {

FILE: libs/desim/src/world.rs
  type NodeId (line 17) | pub type NodeId = u32;
  type World (line 20) | pub struct World {
    method new (line 35) | pub fn new(seed: u64, options: Arc<NetworkOptions>) -> World {
    method step (line 61) | pub fn step(&self) -> bool {
    method get_thread_step_count (line 65) | pub fn get_thread_step_count(&self) -> u64 {
    method new_rng (line 70) | pub fn new_rng(&self) -> StdRng {
    method new_node (line 76) | pub fn new_node(self: &Arc<Self>) -> Arc<Node> {
    method get_node (line 85) | fn get_node(&self, id: NodeId) -> Option<Arc<Node>> {
    method stop_all (line 95) | pub fn stop_all(&self) {
    method open_tcp (line 100) | pub fn open_tcp(self: &Arc<World>, dst: NodeId) -> TCP {
    method now (line 110) | pub fn now(&self) -> u64 {
    method clock (line 115) | pub fn clock(&self) -> Arc<Timing> {
    method add_event (line 119) | pub fn add_event(&self, node: NodeId, data: String) {
    method take_events (line 124) | pub fn take_events(&self) -> Vec<SimEvent> {
    method deallocate (line 131) | pub fn deallocate(&self) {
  type Node (line 139) | pub struct Node {
    method new (line 147) | pub fn new(id: NodeId, world: Arc<World>, rng: StdRng) -> Node {
    method launch (line 157) | pub fn launch(self: &Arc<Self>, f: impl FnOnce(NodeOs) + Send + 'stati...
    method node_events (line 166) | pub fn node_events(&self) -> Chan<NodeEvent> {
    method replug_node_events (line 171) | pub fn replug_node_events(&self, chan: Chan<NodeEvent>) {
    method log_event (line 176) | pub fn log_event(&self, data: String) {

FILE: libs/desim/tests/reliable_copy_test.rs
  type Storage (line 16) | pub trait Storage<T> {
    method flush_pos (line 17) | fn flush_pos(&self) -> u32;
    method flush (line 18) | fn flush(&mut self) -> Result<()>;
    method write (line 19) | fn write(&mut self, t: T);
  type SharedStorage (line 23) | pub struct SharedStorage<T> {
  function new (line 28) | pub fn new() -> Self {
  function flush_pos (line 36) | fn flush_pos(&self) -> u32 {
  function flush (line 40) | fn flush(&mut self) -> Result<()> {
  function write (line 45) | fn write(&mut self, t: T) {
  type InMemoryStorage (line 51) | pub struct InMemoryStorage<T> {
  function new (line 57) | pub fn new() -> Self {
  function flush (line 64) | pub fn flush(&mut self) -> Result<()> {
  function write (line 69) | pub fn write(&mut self, t: T) {
  function run_server (line 75) | pub fn run_server(os: NodeOs, mut storage: Box<dyn Storage<u32>>) {
  function run_client (line 114) | pub fn run_client(os: NodeOs, data: &[ReplCell], dst: NodeId) {
  function sim_example_reliable_copy (line 157) | fn sim_example_reliable_copy() {
  type Options (line 191) | pub struct Options {
  function start_simulation (line 198) | pub fn start_simulation(options: Options) {
  function u32_to_cells (line 222) | pub fn u32_to_cells(data: &[u32], client_id: u32) -> Vec<ReplCell> {
  function verify_data (line 234) | fn verify_data(disk_data: &[u32], data: &[u32]) -> bool {

FILE: libs/http-utils/src/endpoint.rs
  type RequestId (line 40) | struct RequestId(String);
  function request_span (line 74) | pub async fn request_span<R, H>(request: Request<Body>, handler: H) -> R...
  type RequestCancelled (line 127) | struct RequestCancelled {
    method warn_when_dropped_without_responding (line 133) | fn warn_when_dropped_without_responding() -> Self {
    method disarm (line 140) | fn disarm(mut self) {
  method drop (line 146) | fn drop(&mut self) {
  type ChannelWriter (line 161) | pub struct ChannelWriter {
    method new (line 172) | pub fn new(buf_len: usize, tx: mpsc::Sender<std::io::Result<Bytes>>) -...
    method flush0 (line 185) | pub fn flush0(&mut self) -> std::io::Result<usize> {
    method flushed_bytes (line 218) | pub fn flushed_bytes(&self) -> usize {
    method wait_time (line 222) | pub fn wait_time(&self) -> std::time::Duration {
    method write (line 228) | fn write(&mut self, mut buf: &[u8]) -> std::io::Result<usize> {
    method flush (line 249) | fn flush(&mut self) -> std::io::Result<()> {
  function prometheus_metrics_handler (line 254) | pub async fn prometheus_metrics_handler(
  function profile_cpu_handler (line 368) | pub async fn profile_cpu_handler(req: Request<Body>) -> Result<Response<...
  function profile_heap_handler (line 464) | pub async fn profile_heap_handler(req: Request<Body>) -> Result<Response...
  function add_request_id_middleware (line 538) | pub fn add_request_id_middleware<B: hyper::body::HttpBody + Send + Sync ...
  function add_request_id_header_to_response (line 557) | async fn add_request_id_header_to_response(
  function make_router (line 571) | pub fn make_router() -> RouterBuilder<hyper::Body, ApiError> {
  function attach_openapi_ui (line 580) | pub fn attach_openapi_ui(
  function parse_token (line 628) | fn parse_token(header_value: &str) -> Result<&str, ApiError> {
  function auth_middleware (line 641) | pub fn auth_middleware<B: hyper::body::HttpBody + Send + Sync + 'static>(
  function add_response_header_middleware (line 671) | pub fn add_response_header_middleware<B>(
  function check_permission_with (line 703) | pub fn check_permission_with(
  function test_request_id_returned (line 725) | async fn test_request_id_returned() {
  function test_request_id_empty (line 745) | async fn test_request_id_empty() {

FILE: libs/http-utils/src/error.rs
  type ApiError (line 11) | pub enum ApiError {
    method into_response (line 50) | pub fn into_response(self) -> Response<Body> {
    method from (line 102) | fn from(_value: AuthError) -> Self {
  type HttpErrorBody (line 111) | pub struct HttpErrorBody {
    method from_msg (line 116) | pub fn from_msg(msg: String) -> Self {
    method response_from_msg_and_status (line 120) | pub fn response_from_msg_and_status(msg: String, status: StatusCode) -...
    method to_response (line 124) | pub fn to_response(&self, status: StatusCode) -> Response<Body> {
  function route_error_handler (line 134) | pub async fn route_error_handler(err: routerify::RouteError) -> Response...
  function api_error_handler (line 149) | pub fn api_error_handler(api_error: ApiError) -> Response<Body> {

FILE: libs/http-utils/src/failpoints.rs
  type ConfigureFailpointsRequest (line 9) | pub type ConfigureFailpointsRequest = Vec<FailpointConfig>;
  type FailpointConfig (line 13) | pub struct FailpointConfig {
  function failpoints_handler (line 23) | pub async fn failpoints_handler(

FILE: libs/http-utils/src/json.rs
  function json_request (line 9) | pub async fn json_request<T: for<'de> Deserialize<'de>>(
  function json_request_maybe (line 32) | pub async fn json_request_maybe<T: for<'de> Deserialize<'de> + Default>(
  function json_response (line 52) | pub fn json_response<T: Serialize>(

FILE: libs/http-utils/src/request.rs
  function get_request_param (line 12) | pub fn get_request_param<'a>(
  function parse_request_param (line 24) | pub fn parse_request_param<T: FromStr>(
  function get_query_param (line 36) | pub fn get_query_param<'a>(
  function must_get_query_param (line 76) | pub fn must_get_query_param<'a>(
  function parse_query_param (line 85) | pub fn parse_query_param<E: fmt::Display, T: FromStr<Err = E>>(
  function must_parse_query_param (line 98) | pub fn must_parse_query_param<E: fmt::Display, T: FromStr<Err = E>>(
  function ensure_no_body (line 107) | pub async fn ensure_no_body(request: &mut Request<Body>) -> Result<(), A...
  function test_get_query_param_duplicate (line 119) | fn test_get_query_param_duplicate() {

FILE: libs/http-utils/src/server.rs
  type Server (line 25) | pub struct Server {
    method new (line 50) | pub fn new(
    method serve (line 66) | pub async fn serve(self, cancel: CancellationToken) -> anyhow::Result<...
    method serve_connection (line 179) | async fn serve_connection<I>(

FILE: libs/http-utils/src/tls_certs.rs
  function load_cert_chain (line 15) | pub async fn load_cert_chain(filename: &Utf8Path) -> anyhow::Result<Vec<...
  function load_private_key (line 28) | pub async fn load_private_key(filename: &Utf8Path) -> anyhow::Result<Pri...
  function load_certified_key (line 43) | pub async fn load_certified_key(
  type ParsedCertifiedKey (line 60) | struct ParsedCertifiedKey {
  function parse_expiration_time (line 66) | fn parse_expiration_time(cert: &CertificateDer<'_>) -> anyhow::Result<Un...
  function load_and_parse_certified_key (line 81) | async fn load_and_parse_certified_key(
  type ReloadingCertificateResolver (line 132) | pub struct ReloadingCertificateResolver {
    method new (line 140) | pub async fn new(
  method resolve (line 211) | fn resolve(&self, _client_hello: ClientHello<'_>) -> Option<Arc<Certifie...

FILE: libs/metrics/src/hll.rs
  type HyperLogLogVec (line 91) | pub type HyperLogLogVec<L, const N: usize> = MetricVec<HyperLogLogState<...
  type HyperLogLog (line 92) | pub type HyperLogLog<const N: usize> = Metric<HyperLogLogState<N>>;
  type HyperLogLogState (line 94) | pub struct HyperLogLogState<const N: usize> {
  method default (line 98) | fn default() -> Self {
  type Metadata (line 106) | type Metadata = ();
  function measure (line 110) | pub fn measure(&self, item: &(impl Hash + ?Sized)) {
  function record (line 115) | fn record(&self, hash: u64) {
  function take_sample (line 122) | fn take_sample(&self) -> [u8; N] {
  function write_type (line 141) | fn write_type(
  function collect_into (line 147) | fn collect_into(
  type Label (line 202) | enum Label {
  function collect (line 207) | fn collect(hll: &HyperLogLogVec<StaticLabelSet<Label>, 32>) -> ([u8; 32]...
  function get_cardinality (line 216) | fn get_cardinality(samples: &[[u8; 32]]) -> f64 {
  function test_cardinality (line 234) | fn test_cardinality(n: usize, dist: impl Distribution<f64>) -> ([usize; ...
  function test_cardinality_small (line 262) | fn test_cardinality_small() {
  function test_cardinality_medium (line 272) | fn test_cardinality_medium() {
  function test_cardinality_large (line 282) | fn test_cardinality_large() {
  function test_cardinality_small2 (line 293) | fn test_cardinality_small2() {
  function test_cardinality_medium2 (line 303) | fn test_cardinality_medium2() {
  function test_cardinality_large2 (line 313) | fn test_cardinality_large2() {

FILE: libs/metrics/src/launch_timestamp.rs
  type LaunchTimestamp (line 9) | pub struct LaunchTimestamp(chrono::DateTime<Utc>);
    method generate (line 12) | pub fn generate() -> Self {
  method fmt (line 18) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function set_launch_timestamp_metric (line 23) | pub fn set_launch_timestamp_metric(launch_ts: &'static LaunchTimestamp) {

FILE: libs/metrics/src/lib.rs
  type UIntGauge (line 39) | pub type UIntGauge = GenericGauge<AtomicU64>;
  type UIntGaugeVec (line 40) | pub type UIntGaugeVec = GenericGaugeVec<AtomicU64>;
  function register_internal (line 66) | pub fn register_internal(c: Box<dyn Collector>) -> prometheus::Result<()> {
  function gather (line 74) | pub fn gather() -> Vec<prometheus::proto::MetricFamily> {
  constant DISK_FSYNC_SECONDS_BUCKETS (line 101) | pub const DISK_FSYNC_SECONDS_BUCKETS: &[f64] =
  function pow2_buckets (line 106) | pub fn pow2_buckets(start: usize, end: usize) -> Vec<f64> {
  type InfoMetric (line 121) | pub struct InfoMetric<L: LabelGroup, M: MetricType = GaugeState> {
  function new (line 127) | pub fn new(label: L) -> Self {
  method default (line 133) | fn default() -> Self {
  function with_metric (line 139) | pub fn with_metric(label: L, metric: M) -> Self {
  function set_label (line 146) | pub fn set_label(&self, label: L) {
  function collect_family_into (line 157) | fn collect_family_into(
  type BuildInfo (line 168) | pub struct BuildInfo {
  method visit_values (line 174) | fn visit_values(&self, v: &mut impl LabelGroupVisitor) {
  type NeonMetrics (line 184) | pub struct NeonMetrics {
  type LibMetrics (line 197) | pub struct LibMetrics {
  function write_gauge (line 207) | fn write_gauge<Enc: Encoding>(
  type Rusage (line 220) | struct Rusage;
    method collect_group_into (line 233) | fn collect_group_into(&self, enc: &mut T) -> Result<(), T::Err> {
  type IoOp (line 224) | enum IoOp {
  type CollectionCounter (line 256) | struct CollectionCounter(CounterState);
    method collect_family_into (line 262) | fn collect_family_into(
  function set_build_info_metric (line 273) | pub fn set_build_info_metric(revision: &str, build_tag: &str) {
  constant BYTES_IN_BLOCK (line 282) | const BYTES_IN_BLOCK: i64 = 512;
  function update_rusage_metrics (line 292) | fn update_rusage_metrics() {
  function get_rusage_stats (line 313) | fn get_rusage_stats() -> libc::rusage {
  type GenericCounterPairVec (line 353) | pub struct GenericCounterPairVec<P: Atomic> {
  type GenericCounterPair (line 359) | pub struct GenericCounterPair<P: Atomic> {
  function new (line 365) | pub fn new(inc: GenericCounterVec<P>, dec: GenericCounterVec<P>) -> Self {
  function get_metric_with_label_values (line 375) | pub fn get_metric_with_label_values(
  function with_label_values (line 387) | pub fn with_label_values(&self, vals: &[&str]) -> GenericCounterPair<P> {
  function remove_label_values (line 391) | pub fn remove_label_values(&self, res: &mut [prometheus::Result<()>; 2],...
  function new (line 398) | pub fn new(inc: GenericCounter<P>, dec: GenericCounter<P>) -> Self {
  function guard (line 403) | pub fn guard(&self) -> GenericCounterPairGuard<P> {
  function guard_by (line 409) | pub fn guard_by(&self, n: P::T) -> GenericCounterPairGuardBy<P> {
  function inc (line 416) | pub fn inc(&self) {
  function dec (line 422) | pub fn dec(&self) {
  function inc_by (line 429) | pub fn inc_by(&self, v: P::T) {
  function dec_by (line 436) | pub fn dec_by(&self, v: P::T) {
  method clone (line 442) | fn clone(&self) -> Self {
  type GenericCounterPairGuard (line 451) | pub struct GenericCounterPairGuard<P: Atomic>(GenericCounter<P>);
  method drop (line 454) | fn drop(&mut self) {
  type GenericCounterPairGuardBy (line 459) | pub struct GenericCounterPairGuardBy<P: Atomic>(GenericCounter<P>, P::T);
  method drop (line 462) | fn drop(&mut self) {
  type IntCounterPairVec (line 468) | pub type IntCounterPairVec = GenericCounterPairVec<AtomicU64>;
  type IntCounterPair (line 471) | pub type IntCounterPair = GenericCounterPair<AtomicU64>;
  type IntCounterPairGuard (line 474) | pub type IntCounterPairGuard = GenericCounterPairGuard<AtomicU64>;
  type CounterPairAssoc (line 476) | pub trait CounterPairAssoc {
    constant INC_NAME (line 477) | const INC_NAME: &'static MetricName;
    constant DEC_NAME (line 478) | const DEC_NAME: &'static MetricName;
    constant INC_HELP (line 480) | const INC_HELP: &'static str;
    constant DEC_HELP (line 481) | const DEC_HELP: &'static str;
  type CounterPairVec (line 486) | pub struct CounterPairVec<A: CounterPairAssoc> {
  method default (line 494) | fn default() -> Self {
  function guard (line 502) | pub fn guard(
  function inc (line 510) | pub fn inc(&self, labels: <A::LabelGroupSet as LabelGroupSet>::Group<'_>) {
  function dec (line 514) | pub fn dec(&self, labels: <A::LabelGroupSet as LabelGroupSet>::Group<'_>) {
  function remove_metric (line 518) | pub fn remove_metric(
  function sample (line 526) | pub fn sample(&self, labels: <A::LabelGroupSet as LabelGroupSet>::Group<...
  function collect_group_into (line 542) | fn collect_group_into(&self, enc: &mut T) -> Result<(), T::Err> {
  type MeasuredCounterPairState (line 557) | pub struct MeasuredCounterPairState {
    type Metadata (line 563) | type Metadata = ();
    method write_type (line 594) | fn write_type(name: impl MetricNameEncoder, enc: &mut Inc<T>) -> Resul...
    method collect_into (line 597) | fn collect_into(
    method write_type (line 621) | fn write_type(name: impl MetricNameEncoder, enc: &mut Dec<T>) -> Resul...
    method collect_into (line 624) | fn collect_into(
  type MeasuredCounterPairGuard (line 566) | pub struct MeasuredCounterPairGuard<'a, A: CounterPairAssoc> {
  method drop (line 572) | fn drop(&mut self) {
  type Inc (line 578) | struct Inc<T>(T);
  type Dec (line 580) | struct Dec<T>(T);
  type Err (line 583) | type Err = T::Err;
  method write_help (line 585) | fn write_help(&mut self, name: impl MetricNameEncoder, help: &str) -> Re...
  type Err (line 609) | type Err = T::Err;
  method write_help (line 611) | fn write_help(&mut self, name: impl MetricNameEncoder, help: &str) -> Re...
  constant POW2_BUCKETS_MAX (line 639) | const POW2_BUCKETS_MAX: usize = 1 << (usize::BITS - 1);
  function pow2_buckets_cases (line 642) | fn pow2_buckets_cases() {
  function pow2_buckets_zero_start (line 676) | fn pow2_buckets_zero_start() {
  function pow2_buckets_end_lt_start (line 682) | fn pow2_buckets_end_lt_start() {
  function pow2_buckets_end_overflow_min (line 688) | fn pow2_buckets_end_overflow_min() {
  function pow2_buckets_end_overflow_max (line 694) | fn pow2_buckets_end_overflow_max() {

FILE: libs/metrics/src/more_process_metrics.rs
  type Collector (line 10) | pub struct Collector {
    method desc (line 30) | fn desc(&self) -> Vec<&prometheus::core::Desc> {
    method collect (line 34) | fn collect(&self) -> Vec<prometheus::proto::MetricFamily> {
    method new (line 56) | pub fn new() -> Self {
  constant NMETRICS (line 16) | const NMETRICS: usize = 2;
  method default (line 88) | fn default() -> Self {

FILE: libs/metrics/src/wrappers.rs
  type CountedReader (line 41) | pub struct CountedReader<'a, T> {
  function new (line 47) | pub fn new(reader: T, update_counter: impl FnMut(usize) + Sync + Send + ...
  function inner (line 55) | pub fn inner(&self) -> &T {
  function inner_mut (line 60) | pub fn inner_mut(&mut self) -> &mut T {
  function into_inner (line 65) | pub fn into_inner(self) -> T {
  method read (line 71) | fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
  type CountedWriter (line 112) | pub struct CountedWriter<'a, T> {
  function new (line 118) | pub fn new(writer: T, update_counter: impl FnMut(usize) + Sync + Send + ...
  function inner (line 126) | pub fn inner(&self) -> &T {
  function inner_mut (line 131) | pub fn inner_mut(&mut self) -> &mut T {
  function into_inner (line 136) | pub fn into_inner(self) -> T {
  method write (line 142) | fn write(&mut self, buf: &[u8]) -> Result<usize> {
  method flush (line 148) | fn flush(&mut self) -> Result<()> {
  function test_counted_reader (line 158) | fn test_counted_reader() {
  function test_counted_writer (line 174) | fn test_counted_writer() {
  function assert_send_sync (line 190) | fn assert_send_sync(_x: impl Sync + Send + 'static) {}
  function test_send_sync_counted_reader (line 193) | fn test_send_sync_counted_reader() {
  function test_send_sync_counted_writer (line 203) | fn test_send_sync_counted_writer() {

FILE: libs/neon-shmem/src/hash.rs
  type HashMapShrinkError (line 38) | pub enum HashMapShrinkError {
  type HashMapInit (line 51) | pub struct HashMapInit<'a, K, V, S = rustc_hash::FxBuildHasher> {
  type HashMapAccess (line 65) | pub struct HashMapAccess<'a, K, V, S = rustc_hash::FxBuildHasher> {
  function with_hasher (line 81) | pub fn with_hasher<T: BuildHasher>(self, hasher: T) -> HashMapInit<'a, K...
  function estimate_size (line 92) | pub fn estimate_size(num_buckets: u32) -> usize {
  function new (line 97) | fn new(
  function attach_writer (line 149) | pub fn attach_writer(self) -> HashMapAccess<'a, K, V, S> {
  function attach_reader (line 161) | pub fn attach_reader(self) -> HashMapAccess<'a, K, V, S> {
  type HashMapShared (line 178) | type HashMapShared<'a, K, V> = RwLock<CoreHashMap<'a, K, V>>;
  function with_fixed (line 185) | pub fn with_fixed(num_buckets: u32, area: &'a mut [MaybeUninit<u8>]) -> ...
  function with_shmem (line 199) | pub fn with_shmem(num_buckets: u32, shmem: ShmemHandle) -> Self {
  function new_resizeable_named (line 215) | pub fn new_resizeable_named(num_buckets: u32, max_buckets: u32, name: &s...
  function new_resizeable (line 232) | pub fn new_resizeable(num_buckets: u32, max_buckets: u32) -> Self {
  function get_hash_value (line 247) | fn get_hash_value(&self, key: &K) -> u64 {
  function entry_with_hash (line 251) | fn entry_with_hash(&self, key: K, hash: u64) -> Entry<'a, '_, K, V> {
  function get (line 293) | pub fn get<'e>(&'e self, key: &K) -> Option<ValueReadGuard<'e, V>> {
  function entry (line 303) | pub fn entry(&self, key: K) -> Entry<'a, '_, K, V> {
  function remove (line 309) | pub fn remove(&self, key: &K) -> Option<V> {
  function insert (line 321) | pub fn insert(&self, key: K, value: V) -> Result<Option<V>, core::FullEr...
  function entry_at_bucket (line 337) | pub fn entry_at_bucket(&self, pos: usize) -> Option<OccupiedEntry<'a, '_...
  function get_num_buckets (line 356) | pub fn get_num_buckets(&self) -> usize {
  function get_at_bucket (line 366) | pub fn get_at_bucket(&self, pos: usize) -> Option<ValueReadGuard<'_, (K,...
  function get_bucket_for_value (line 375) | pub fn get_bucket_for_value(&self, val_ptr: *const V) -> usize {
  function get_num_buckets_in_use (line 386) | pub fn get_num_buckets_in_use(&self) -> usize {
  function clear (line 392) | pub fn clear(&self) {
  function rehash_dict (line 400) | fn rehash_dict(
  function shuffle (line 445) | pub fn shuffle(&self) {
  function grow (line 465) | pub fn grow(&self, num_buckets: u32) -> Result<(), shmem::Error> {
  function begin_shrink (line 513) | pub fn begin_shrink(&mut self, num_buckets: u32) {
  function shrink_goal (line 527) | pub fn shrink_goal(&self) -> Option<usize> {
  function finish_shrink (line 543) | pub fn finish_shrink(&self) -> Result<(), HashMapShrinkError> {

FILE: libs/neon-shmem/src/hash/core.rs
  constant INVALID_POS (line 9) | pub(crate) const INVALID_POS: u32 = u32::MAX;
  type Bucket (line 13) | pub(crate) struct Bucket<K, V> {
  type CoreHashMap (line 21) | pub(crate) struct CoreHashMap<'a, K, V> {
  type FullError (line 36) | pub struct FullError;
  constant FILL_FACTOR (line 39) | const FILL_FACTOR: f32 = 0.60;
  function estimate_size (line 42) | pub fn estimate_size(num_buckets: u32) -> usize {
  function new (line 55) | pub fn new(
  function get_with_hash (line 93) | pub fn get_with_hash(&self, key: &K, hash: u64) -> Option<&V> {
  function get_num_buckets (line 110) | pub fn get_num_buckets(&self) -> usize {
  function clear (line 117) | pub fn clear(&mut self) {
  function alloc_bucket (line 137) | pub(crate) fn alloc_bucket(&mut self, key: K, value: V) -> Result<u32, F...

FILE: libs/neon-shmem/src/hash/entry.rs
  type Entry (line 9) | pub enum Entry<'a, 'b, K, V> {
  type PrevPos (line 16) | pub(crate) enum PrevPos {
  type OccupiedEntry (line 25) | pub struct OccupiedEntry<'a, 'b, K, V> {
  function get (line 37) | pub fn get(&self) -> &V {
  function get_mut (line 45) | pub fn get_mut(&mut self) -> &mut V {
  function insert (line 54) | pub fn insert(&mut self, value: V) -> V {
  function remove (line 64) | pub fn remove(mut self) -> V {
  type VacantEntry (line 107) | pub struct VacantEntry<'a, 'b, K, V> {
  function insert (line 121) | pub fn insert(mut self, value: V) -> Result<ValueWriteGuard<'b, V>, Full...

FILE: libs/neon-shmem/src/hash/tests.rs
  constant TEST_KEY_LEN (line 15) | const TEST_KEY_LEN: usize = 16;
  type TestKey (line 18) | struct TestKey([u8; TEST_KEY_LEN]);
    method from (line 27) | fn from(val: u128) -> TestKey {
    method from (line 33) | fn from(bytes: &'a [u8]) -> TestKey {
  function from (line 21) | fn from(val: &TestKey) -> u128 {
  function test_inserts (line 38) | fn test_inserts<K: Into<TestKey> + Copy>(keys: &[K]) {
  function dense (line 63) | fn dense() {
  function sparse (line 80) | fn sparse() {
  type TestOp (line 99) | struct TestOp(TestKey, Option<usize>);
  function apply_op (line 101) | fn apply_op(
  function do_random_ops (line 131) | fn do_random_ops(
  function do_deletes (line 153) | fn do_deletes(
  function do_shrink (line 164) | fn do_shrink(
  function random_ops (line 186) | fn random_ops() {
  function test_shuffle (line 204) | fn test_shuffle() {
  function test_grow (line 216) | fn test_grow() {
  function test_clear (line 231) | fn test_clear() {
  function test_idx_remove (line 253) | fn test_idx_remove() {
  function test_idx_get (line 272) | fn test_idx_get() {
  function test_shrink (line 294) | fn test_shrink() {
  function test_shrink_grow_seq (line 309) | fn test_shrink_grow_seq() {
  function test_bucket_ops (line 335) | fn test_bucket_ops() {
  function test_shrink_zero (line 369) | fn test_shrink_zero() {
  function test_grow_oom (line 397) | fn test_grow_oom() {
  function test_shrink_bigger (line 405) | fn test_shrink_bigger() {
  function test_shrink_early_finish (line 414) | fn test_shrink_early_finish() {
  function test_shrink_fixed_size (line 423) | fn test_shrink_fixed_size() {

FILE: libs/neon-shmem/src/shmem.rs
  type ShmemHandle (line 24) | pub struct ShmemHandle {
    method new (line 72) | pub fn new(name: &str, initial_size: usize, max_size: usize) -> Result...
    method new_with_fd (line 79) | fn new_with_fd(fd: OwnedFd, initial_size: usize, max_size: usize) -> R...
    method shared (line 135) | fn shared(&self) -> &SharedStruct {
    method set_size (line 144) | pub fn set_size(&self, new_size: usize) -> Result<(), Error> {
    method current_size (line 206) | pub fn current_size(&self) -> usize {
  type SharedStruct (line 38) | struct SharedStruct {
  constant RESIZE_IN_PROGRESS (line 45) | const RESIZE_IN_PROGRESS: usize = 1 << 63;
  constant HEADER_SIZE (line 47) | const HEADER_SIZE: usize = std::mem::size_of::<SharedStruct>();
  type Error (line 52) | pub struct Error {
    method new (line 58) | fn new(msg: &str, errno: Errno) -> Self {
  method drop (line 214) | fn drop(&mut self) {
  function create_backing_file (line 228) | fn create_backing_file(name: &str) -> Result<OwnedFd, Error> {
  function enlarge_file (line 246) | fn enlarge_file(fd: BorrowedFd, size: u64) -> Result<(), Error> {
  function assert_range (line 270) | fn assert_range(ptr: *const u8, expected: u8, range: Range<usize>) {
  function write_range (line 278) | fn write_range(ptr: *mut u8, b: u8, range: Range<usize>) {
  function test_shmem_resize (line 284) | fn test_shmem_resize() -> Result<(), Error> {
  type SimpleBarrier (line 327) | struct SimpleBarrier {
    method init (line 333) | unsafe fn init(ptr: *mut SimpleBarrier, num_procs: usize) {
    method wait (line 342) | pub fn wait(&self) {
  function test_multi_process (line 356) | fn test_multi_process() {

FILE: libs/neon-shmem/src/sync.rs
  type RwLock (line 8) | pub type RwLock<T> = lock_api::RwLock<PthreadRwLock, T>;
  type RwLockReadGuard (line 9) | pub type RwLockReadGuard<'a, T> = lock_api::RwLockReadGuard<'a, PthreadR...
  type RwLockWriteGuard (line 10) | pub type RwLockWriteGuard<'a, T> = lock_api::RwLockWriteGuard<'a, Pthrea...
  type ValueReadGuard (line 11) | pub type ValueReadGuard<'a, T> = lock_api::MappedRwLockReadGuard<'a, Pth...
  type ValueWriteGuard (line 12) | pub type ValueWriteGuard<'a, T> = lock_api::MappedRwLockWriteGuard<'a, P...
  type PthreadRwLock (line 15) | pub struct PthreadRwLock(Option<NonNull<libc::pthread_rwlock_t>>);
    method new (line 32) | pub unsafe fn new(lock: *mut libc::pthread_rwlock_t) -> Self {
    method inner (line 49) | fn inner(&self) -> NonNull<libc::pthread_rwlock_t> {
    type GuardMarker (line 60) | type GuardMarker = lock_api::GuardSend;
    constant INIT (line 61) | const INIT: Self = Self(None);
    method try_lock_shared (line 63) | fn try_lock_shared(&self) -> bool {
    method try_lock_exclusive (line 77) | fn try_lock_exclusive(&self) -> bool {
    method lock_shared (line 88) | fn lock_shared(&self) {
    method lock_exclusive (line 94) | fn lock_exclusive(&self) {
    method unlock_exclusive (line 100) | unsafe fn unlock_exclusive(&self) {
    method unlock_shared (line 106) | unsafe fn unlock_shared(&self) {

FILE: libs/pageserver_api/src/config.rs
  constant DEFAULT_PG_LISTEN_PORT (line 9) | pub const DEFAULT_PG_LISTEN_PORT: u16 = 64000;
  constant DEFAULT_PG_LISTEN_ADDR (line 10) | pub const DEFAULT_PG_LISTEN_ADDR: &str = formatcp!("127.0.0.1:{DEFAULT_P...
  constant DEFAULT_HTTP_LISTEN_PORT (line 11) | pub const DEFAULT_HTTP_LISTEN_PORT: u16 = 9898;
  constant DEFAULT_HTTP_LISTEN_ADDR (line 12) | pub const DEFAULT_HTTP_LISTEN_ADDR: &str = formatcp!("127.0.0.1:{DEFAULT...
  constant DEFAULT_GRPC_LISTEN_PORT (line 14) | pub const DEFAULT_GRPC_LISTEN_PORT: u16 = 51051;
  type NodeMetadata (line 34) | pub struct NodeMetadata {
  method fmt (line 52) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type PostHogConfig (line 71) | pub struct PostHogConfig {
    method try_into_posthog_config (line 102) | pub fn try_into_posthog_config(self) -> Result<PostHogClientConfig, &'...
  type ConfigToml (line 184) | pub struct ConfigToml {
  type DiskUsageEvictionTaskConfig (line 282) | pub struct DiskUsageEvictionTaskConfig {
  method default (line 296) | fn default() -> Self {
  type PageServicePipeliningConfig (line 311) | pub enum PageServicePipeliningConfig {
  type PageServicePipeliningConfigPipelined (line 316) | pub struct PageServicePipeliningConfigPipelined {
  type PageServiceProtocolPipelinedExecutionStrategy (line 328) | pub enum PageServiceProtocolPipelinedExecutionStrategy {
  type PageServiceProtocolPipelinedBatchingStrategy (line 335) | pub enum PageServiceProtocolPipelinedBatchingStrategy {
  type GetVectoredConcurrentIo (line 348) | pub enum GetVectoredConcurrentIo {
  type Ratio (line 365) | pub struct Ratio {
  type OtelExporterConfig (line 371) | pub struct OtelExporterConfig {
  type OtelExporterProtocol (line 380) | pub enum OtelExporterProtocol {
  type Tracing (line 387) | pub struct Tracing {
  function from (line 393) | fn from(val: &OtelExporterConfig) -> Self {
  function from (line 403) | fn from(val: OtelExporterProtocol) -> Self {
  type TimelineImportConfig (line 413) | pub struct TimelineImportConfig {
  type BasebackupCacheConfig (line 423) | pub struct BasebackupCacheConfig {
  method default (line 439) | fn default() -> Self {
  type Behavior (line 454) | pub enum Behavior {
  type MockedError (line 467) | pub enum MockedError {
  function from (line 473) | fn from(e: MockedError) -> Self {
  type EvictionOrder (line 484) | pub enum EvictionOrder {
  method default (line 491) | fn default() -> Self {
  type MaxVectoredReadBytes (line 500) | pub struct MaxVectoredReadBytes(pub NonZeroUsize);
  type MaxGetVectoredKeys (line 504) | pub struct MaxGetVectoredKeys(NonZeroUsize);
    method get (line 507) | pub fn get(&self) -> usize {
  type TenantConfigToml (line 515) | pub struct TenantConfigToml {
  constant DEFAULT_WAIT_LSN_TIMEOUT (line 661) | pub const DEFAULT_WAIT_LSN_TIMEOUT: &str = "300 s";
  constant DEFAULT_WAL_REDO_TIMEOUT (line 662) | pub const DEFAULT_WAL_REDO_TIMEOUT: &str = "60 s";
  constant DEFAULT_SUPERUSER (line 664) | pub const DEFAULT_SUPERUSER: &str = "cloud_admin";
  constant DEFAULT_LOCALE (line 665) | pub const DEFAULT_LOCALE: &str = if cfg!(target_os = "macos") {
  constant DEFAULT_PAGE_CACHE_SIZE (line 671) | pub const DEFAULT_PAGE_CACHE_SIZE: usize = 8192;
  constant DEFAULT_MAX_FILE_DESCRIPTORS (line 672) | pub const DEFAULT_MAX_FILE_DESCRIPTORS: usize = 100;
  constant DEFAULT_LOG_FORMAT (line 674) | pub const DEFAULT_LOG_FORMAT: &str = "plain";
  constant DEFAULT_CONCURRENT_TENANT_WARMUP (line 676) | pub const DEFAULT_CONCURRENT_TENANT_WARMUP: usize = 8;
  constant DEFAULT_CONCURRENT_TENANT_SIZE_LOGICAL_SIZE_QUERIES (line 678) | pub const DEFAULT_CONCURRENT_TENANT_SIZE_LOGICAL_SIZE_QUERIES: usize = 1;
  constant DEFAULT_METRIC_COLLECTION_INTERVAL (line 680) | pub const DEFAULT_METRIC_COLLECTION_INTERVAL: &str = "10 min";
  constant DEFAULT_METRIC_COLLECTION_ENDPOINT (line 681) | pub const DEFAULT_METRIC_COLLECTION_ENDPOINT: Option<reqwest::Url> = None;
  constant DEFAULT_SYNTHETIC_SIZE_CALCULATION_INTERVAL (line 682) | pub const DEFAULT_SYNTHETIC_SIZE_CALCULATION_INTERVAL: &str = "10 min";
  constant DEFAULT_BACKGROUND_TASK_MAXIMUM_DELAY (line 683) | pub const DEFAULT_BACKGROUND_TASK_MAXIMUM_DELAY: &str = "10s";
  constant DEFAULT_HEATMAP_UPLOAD_CONCURRENCY (line 685) | pub const DEFAULT_HEATMAP_UPLOAD_CONCURRENCY: usize = 8;
  constant DEFAULT_SECONDARY_DOWNLOAD_CONCURRENCY (line 686) | pub const DEFAULT_SECONDARY_DOWNLOAD_CONCURRENCY: usize = 1;
  constant DEFAULT_INGEST_BATCH_SIZE (line 688) | pub const DEFAULT_INGEST_BATCH_SIZE: u64 = 100;
  constant DEFAULT_MAX_VECTORED_READ_BYTES (line 697) | pub const DEFAULT_MAX_VECTORED_READ_BYTES: usize = 130 * 1024;
  constant DEFAULT_MAX_GET_VECTORED_KEYS (line 699) | pub const DEFAULT_MAX_GET_VECTORED_KEYS: usize = 32;
  constant DEFAULT_IMAGE_COMPRESSION (line 701) | pub const DEFAULT_IMAGE_COMPRESSION: ImageCompressionAlgorithm =
  constant DEFAULT_EPHEMERAL_BYTES_PER_MEMORY_KB (line 704) | pub const DEFAULT_EPHEMERAL_BYTES_PER_MEMORY_KB: usize = 0;
  constant DEFAULT_IO_BUFFER_ALIGNMENT (line 707) | pub const DEFAULT_IO_BUFFER_ALIGNMENT: usize = 4096;
  constant DEFAULT_IO_BUFFER_ALIGNMENT (line 709) | pub const DEFAULT_IO_BUFFER_ALIGNMENT: usize = 512;
  constant DEFAULT_IO_BUFFER_ALIGNMENT (line 711) | pub const DEFAULT_IO_BUFFER_ALIGNMENT: usize = 512;
  constant DEFAULT_SSL_KEY_FILE (line 713) | pub const DEFAULT_SSL_KEY_FILE: &str = "server.key";
  constant DEFAULT_SSL_CERT_FILE (line 714) | pub const DEFAULT_SSL_CERT_FILE: &str = "server.crt";
  method default (line 718) | fn default() -> Self {
  constant DEFAULT_CHECKPOINT_DISTANCE (line 851) | pub const DEFAULT_CHECKPOINT_DISTANCE: u64 = 256 * 1024 * 1024;
  constant DEFAULT_CHECKPOINT_TIMEOUT (line 852) | pub const DEFAULT_CHECKPOINT_TIMEOUT: &str = "10 m";
  constant DEFAULT_COMPACTION_TARGET_SIZE (line 859) | pub const DEFAULT_COMPACTION_TARGET_SIZE: u64 = 128 * 1024 * 1024;
  constant DEFAULT_COMPACTION_PERIOD (line 861) | pub const DEFAULT_COMPACTION_PERIOD: &str = "20 s";
  constant DEFAULT_COMPACTION_THRESHOLD (line 862) | pub const DEFAULT_COMPACTION_THRESHOLD: usize = 10;
  constant DEFAULT_COMPACTION_SHARD_ANCESTOR (line 863) | pub const DEFAULT_COMPACTION_SHARD_ANCESTOR: bool = true;
  constant DEFAULT_COMPACTION_UPPER_LIMIT (line 869) | pub const DEFAULT_COMPACTION_UPPER_LIMIT: usize = 10;
  constant DEFAULT_COMPACTION_L0_FIRST (line 872) | pub const DEFAULT_COMPACTION_L0_FIRST: bool = true;
  constant DEFAULT_COMPACTION_L0_SEMAPHORE (line 873) | pub const DEFAULT_COMPACTION_L0_SEMAPHORE: bool = true;
  constant DEFAULT_COMPACTION_ALGORITHM (line 875) | pub const DEFAULT_COMPACTION_ALGORITHM: crate::models::CompactionAlgorit...
  constant DEFAULT_GC_HORIZON (line 878) | pub const DEFAULT_GC_HORIZON: u64 = 64 * 1024 * 1024;
  constant DEFAULT_GC_PERIOD (line 884) | pub const DEFAULT_GC_PERIOD: &str = "1 hr";
  constant DEFAULT_IMAGE_CREATION_THRESHOLD (line 885) | pub const DEFAULT_IMAGE_CREATION_THRESHOLD: usize = 3;
  constant DEFAULT_IMAGE_CREATION_PREEMPT_THRESHOLD (line 891) | pub const DEFAULT_IMAGE_CREATION_PREEMPT_THRESHOLD: usize = 3;
  constant DEFAULT_PITR_INTERVAL (line 892) | pub const DEFAULT_PITR_INTERVAL: &str = "7 days";
  constant DEFAULT_WALRECEIVER_CONNECT_TIMEOUT (line 893) | pub const DEFAULT_WALRECEIVER_CONNECT_TIMEOUT: &str = "10 seconds";
  constant DEFAULT_WALRECEIVER_LAGGING_WAL_TIMEOUT (line 894) | pub const DEFAULT_WALRECEIVER_LAGGING_WAL_TIMEOUT: &str = "10 seconds";
  constant DEFAULT_MAX_WALRECEIVER_LSN_WAL_LAG (line 898) | pub const DEFAULT_MAX_WALRECEIVER_LSN_WAL_LAG: u64 = 1024 * 1024 * 1024;
  constant DEFAULT_EVICTIONS_LOW_RESIDENCE_DURATION_METRIC_THRESHOLD (line 899) | pub const DEFAULT_EVICTIONS_LOW_RESIDENCE_DURATION_METRIC_THRESHOLD: &st...
  constant DEFAULT_IMAGE_LAYER_CREATION_CHECK_THRESHOLD (line 902) | pub const DEFAULT_IMAGE_LAYER_CREATION_CHECK_THRESHOLD: u8 = 2;
  constant DEFAULT_GC_COMPACTION_ENABLED (line 903) | pub const DEFAULT_GC_COMPACTION_ENABLED: bool = true;
  constant DEFAULT_GC_COMPACTION_VERIFICATION (line 904) | pub const DEFAULT_GC_COMPACTION_VERIFICATION: bool = true;
  constant DEFAULT_GC_COMPACTION_INITIAL_THRESHOLD_KB (line 905) | pub const DEFAULT_GC_COMPACTION_INITIAL_THRESHOLD_KB: u64 = 5 * 1024 * 1...
  constant DEFAULT_GC_COMPACTION_RATIO_PERCENT (line 906) | pub const DEFAULT_GC_COMPACTION_RATIO_PERCENT: u64 = 100;
  constant DEFAULT_RELSIZE_SNAPSHOT_CACHE_CAPACITY (line 907) | pub const DEFAULT_RELSIZE_SNAPSHOT_CACHE_CAPACITY: usize = 1000;
  method default (line 911) | fn default() -> Self {

FILE: libs/pageserver_api/src/config/tests.rs
  function test_node_metadata_v1_backward_compatibilty (line 4) | fn test_node_metadata_v1_backward_compatibilty() {
  function test_node_metadata_v2_backward_compatibilty (line 28) | fn test_node_metadata_v2_backward_compatibilty() {
  function test_node_metadata_v3_backward_compatibilty (line 53) | fn test_node_metadata_v3_backward_compatibilty() {

FILE: libs/pageserver_api/src/controller_api.rs
  type TenantCreateRequest (line 19) | pub struct TenantCreateRequest {
  type TenantCreateResponseShard (line 39) | pub struct TenantCreateResponseShard {
  type TenantCreateResponse (line 46) | pub struct TenantCreateResponse {
  type NodeRegisterRequest (line 51) | pub struct NodeRegisterRequest {
  type NodeConfigureRequest (line 72) | pub struct NodeConfigureRequest {
  type TenantPolicyRequest (line 80) | pub struct TenantPolicyRequest {
  type AvailabilityZone (line 86) | pub struct AvailabilityZone(pub String);
  method fmt (line 89) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type ShardsPreferredAzsRequest (line 95) | pub struct ShardsPreferredAzsRequest {
  type ShardsPreferredAzsResponse (line 101) | pub struct ShardsPreferredAzsResponse {
  type TenantLocateResponseShard (line 106) | pub struct TenantLocateResponseShard {
  type TenantLocateResponse (line 121) | pub struct TenantLocateResponse {
  type TenantDescribeResponse (line 127) | pub struct TenantDescribeResponse {
  type TenantTimelineDescribeResponse (line 136) | pub struct TenantTimelineDescribeResponse {
  type NodeShardResponse (line 143) | pub struct NodeShardResponse {
  type NodeShard (line 149) | pub struct NodeShard {
  type NodeDescribeResponse (line 158) | pub struct NodeDescribeResponse {
  type TenantDescribeResponseShard (line 177) | pub struct TenantDescribeResponseShard {
  type TenantShardMigrateRequest (line 205) | pub struct TenantShardMigrateRequest {
  type MigrationConfig (line 219) | pub struct MigrationConfig {
  function default_prewarm (line 252) | fn default_prewarm() -> bool {
  method default (line 257) | fn default() -> Self {
  type NodeAvailability (line 269) | pub enum NodeAvailability {
    method from (line 306) | fn from(val: NodeAvailabilityWrapper) -> Self {
  method eq (line 284) | fn eq(&self, other: &Self) -> bool {
  type NodeAvailabilityWrapper (line 299) | pub enum NodeAvailabilityWrapper {
    method from (line 320) | fn from(val: NodeAvailability) -> Self {
  type ShardSchedulingPolicy (line 341) | pub enum ShardSchedulingPolicy {
  method default (line 361) | fn default() -> Self {
  type NodeLifecycle (line 367) | pub enum NodeLifecycle {
  type Err (line 373) | type Err = anyhow::Error;
  method from_str (line 375) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  method from (line 385) | fn from(value: NodeLifecycle) -> String {
  type NodeSchedulingPolicy (line 396) | pub enum NodeSchedulingPolicy {
  type Err (line 406) | type Err = anyhow::Error;
  method from_str (line 408) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  method from (line 422) | fn from(value: NodeSchedulingPolicy) -> String {
  type SkSchedulingPolicy (line 437) | pub enum SkSchedulingPolicy {
  type Err (line 445) | type Err = anyhow::Error;
  method from_str (line 447) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  method from (line 463) | fn from(value: SkSchedulingPolicy) -> String {
  type PlacementPolicy (line 478) | pub enum PlacementPolicy {
    method want_secondaries (line 492) | pub fn want_secondaries(&self) -> usize {
  type TenantShardMigrateResponse (line 502) | pub struct TenantShardMigrateResponse {}
  type MetadataHealthRecord (line 506) | pub struct MetadataHealthRecord {
  type MetadataHealthUpdateRequest (line 513) | pub struct MetadataHealthUpdateRequest {
  type MetadataHealthUpdateResponse (line 519) | pub struct MetadataHealthUpdateResponse {}
  type MetadataHealthListUnhealthyResponse (line 522) | pub struct MetadataHealthListUnhealthyResponse {
  type MetadataHealthListOutdatedRequest (line 527) | pub struct MetadataHealthListOutdatedRequest {
  type MetadataHealthListOutdatedResponse (line 533) | pub struct MetadataHealthListOutdatedResponse {
  type SafekeeperDescribeResponse (line 539) | pub struct SafekeeperDescribeResponse {
  type TimelineSafekeeperPeer (line 555) | pub struct TimelineSafekeeperPeer {
  type SCSafekeeperTimeline (line 562) | pub struct SCSafekeeperTimeline {
  type SCSafekeeperTimelinesResponse (line 569) | pub struct SCSafekeeperTimelinesResponse {
  type SafekeeperTimeline (line 575) | pub struct SafekeeperTimeline {
  type SafekeeperTimelinesResponse (line 582) | pub struct SafekeeperTimelinesResponse {
  type SafekeeperSchedulingPolicyRequest (line 588) | pub struct SafekeeperSchedulingPolicyRequest {
  type TimelineImportRequest (line 594) | pub struct TimelineImportRequest {
  type TimelineSafekeeperMigrateRequest (line 603) | pub struct TimelineSafekeeperMigrateRequest {
  function placement_policy_encoding (line 615) | fn placement_policy_encoding() -> anyhow::Result<()> {
  function test_reject_unknown_field (line 629) | fn test_reject_unknown_field() {
  function test_migrate_request_decode_defaults (line 644) | fn test_migrate_request_decode_defaults() {
  function test_migration_config_decode_defaults (line 663) | fn test_migration_config_decode_defaults() {

FILE: libs/pageserver_api/src/key.rs
  type Key (line 19) | pub struct Key {
    method is_metadata_key (line 120) | pub const fn is_metadata_key(&self) -> bool {
    method from_metadata_key_fixed_size (line 125) | pub fn from_metadata_key_fixed_size(key: &[u8; METADATA_KEY_SIZE]) -> ...
    method from_metadata_key (line 132) | pub fn from_metadata_key(key: &[u8]) -> Self {
    method metadata_key_range (line 137) | pub const fn metadata_key_range() -> Range<Self> {
    method metadata_aux_key_range (line 156) | pub fn metadata_aux_key_range() -> Range<Self> {
    method rel_dir_sparse_key_range (line 174) | pub fn rel_dir_sparse_key_range() -> Range<Self> {
    method is_valid_key_on_write_path_strong (line 196) | pub fn is_valid_key_on_write_path_strong(&self) -> bool {
    method is_valid_key_on_write_path (line 214) | pub fn is_valid_key_on_write_path(&self) -> bool {
    method is_i128_representable (line 218) | pub fn is_i128_representable(&self) -> bool {
    method to_i128 (line 225) | pub fn to_i128(&self) -> i128 {
    method from_i128 (line 235) | pub const fn from_i128(x: i128) -> Self {
    method to_compact (line 246) | pub fn to_compact(&self) -> CompactKey {
    method from_compact (line 250) | pub fn from_compact(k: CompactKey) -> Self {
    method next (line 254) | pub const fn next(&self) -> Key {
    method add (line 258) | pub const fn add(&self, x: u32) -> Key {
    method from_slice (line 290) | pub fn from_slice(b: &[u8]) -> Self {
    method write_to_byte_slice (line 303) | pub fn write_to_byte_slice(&self, buf: &mut [u8]) {
    method fmt (line 326) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    constant MIN (line 343) | pub const MIN: Key = Key {
    constant MAX (line 351) | pub const MAX: Key = Key {
    method from_hex (line 360) | pub fn from_hex(s: &str) -> Result<Self> {
    method is_rel_size_key (line 578) | pub fn is_rel_size_key(&self) -> bool {
    method is_slru_segment_size_key (line 672) | pub fn is_slru_segment_size_key(&self) -> bool {
    method is_slru_dir_key (line 680) | pub fn is_slru_dir_key(&self) -> bool {
    method is_inherited_key (line 827) | pub fn is_inherited_key(self) -> bool {
    method is_sparse (line 836) | pub fn is_sparse(self) -> bool {
    method is_inherited_sparse_key (line 841) | fn is_inherited_sparse_key(self) -> bool {
    method sparse_non_inherited_keyspace (line 846) | pub const fn sparse_non_inherited_keyspace() -> Range<Key> {
    method is_rel_fsm_block_key (line 867) | pub fn is_rel_fsm_block_key(self) -> bool {
    method is_rel_vm_block_key (line 875) | pub fn is_rel_vm_block_key(self) -> bool {
    method to_slru_block (line 883) | pub fn to_slru_block(self) -> anyhow::Result<(SlruKind, u32, BlockNumb...
    method is_slru_block_key (line 902) | pub fn is_slru_block_key(self) -> bool {
    method is_rel_block_key (line 909) | pub fn is_rel_block_key(&self) -> bool {
    method is_rel_block_of_rel (line 914) | pub fn is_rel_block_of_rel(&self, rel: Oid) -> bool {
    method is_rel_dir_key (line 919) | pub fn is_rel_dir_key(&self) -> bool {
    method is_aux_file_key (line 929) | pub fn is_aux_file_key(&self) -> bool {
    method to_rel_block (line 935) | pub fn to_rel_block(self) -> Result<(RelTag, BlockNumber), ToRelBlockE...
    type Err (line 952) | type Err = anyhow::Error;
    method from_str (line 954) | fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
  type CompactKey (line 33) | pub struct CompactKey(i128);
    method raw (line 314) | pub fn raw(&self) -> i128 {
    method from (line 320) | fn from(value: i128) -> Self {
    method fmt (line 336) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  constant KEY_SIZE (line 36) | pub const KEY_SIZE: usize = 18;
  constant METADATA_KEY_SIZE (line 40) | pub const METADATA_KEY_SIZE: usize = 16;
  constant METADATA_KEY_BEGIN_PREFIX (line 43) | pub const METADATA_KEY_BEGIN_PREFIX: u8 = 0x60;
  constant METADATA_KEY_END_PREFIX (line 44) | pub const METADATA_KEY_END_PREFIX: u8 = 0x7F;
  constant RELATION_SIZE_PREFIX (line 47) | pub const RELATION_SIZE_PREFIX: u8 = 0x61;
  constant AUX_KEY_PREFIX (line 50) | pub const AUX_KEY_PREFIX: u8 = 0x62;
  constant REPL_ORIGIN_KEY_PREFIX (line 53) | pub const REPL_ORIGIN_KEY_PREFIX: u8 = 0x63;
  constant DB_DIR_KEY_PREFIX (line 56) | pub const DB_DIR_KEY_PREFIX: u8 = 0x64;
  constant REL_DIR_KEY_PREFIX (line 59) | pub const REL_DIR_KEY_PREFIX: u8 = 0x65;
  type RelDirExists (line 62) | pub enum RelDirExists {
    constant REL_EXISTS_MARKER (line 80) | const REL_EXISTS_MARKER: Bytes = Bytes::from_static(b"r");
    method encode (line 82) | pub fn encode(&self) -> Bytes {
    method decode_option (line 89) | pub fn decode_option(data: Option<impl AsRef<[u8]>>) -> Result<Self, D...
    method decode (line 98) | pub fn decode(data: impl AsRef<[u8]>) -> Result<Self, DecodeError> {
  type DecodeError (line 68) | pub struct DecodeError;
    method fmt (line 71) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  constant SPARSE_TOMBSTONE_MARKER (line 111) | pub const SPARSE_TOMBSTONE_MARKER: Bytes = Bytes::from_static(b"");
  function is_metadata_key_slice (line 114) | pub const fn is_metadata_key_slice(key: &[u8]) -> bool {
  constant DBDIR_KEY (line 470) | pub const DBDIR_KEY: Key = Key {
  function dbdir_key_range (line 480) | pub fn dbdir_key_range(spcnode: Oid, dbnode: Oid) -> Range<Key> {
  function relmap_file_key (line 499) | pub fn relmap_file_key(spcnode: Oid, dbnode: Oid) -> Key {
  function rel_dir_to_key (line 511) | pub fn rel_dir_to_key(spcnode: Oid, dbnode: Oid) -> Key {
  function rel_tag_sparse_key (line 523) | pub fn rel_tag_sparse_key(spcnode: Oid, dbnode: Oid, relnode: Oid, forkn...
  function rel_tag_sparse_key_range (line 534) | pub fn rel_tag_sparse_key_range(spcnode: Oid, dbnode: Oid) -> Range<Key> {
  function rel_block_to_key (line 553) | pub fn rel_block_to_key(rel: RelTag, blknum: BlockNumber) -> Key {
  function rel_size_to_key (line 565) | pub fn rel_size_to_key(rel: RelTag) -> Key {
  function rel_key_range (line 584) | pub fn rel_key_range(rel: RelTag) -> Range<Key> {
  function slru_dir_to_key (line 605) | pub fn slru_dir_to_key(kind: SlruKind) -> Key {
  function slru_dir_kind (line 621) | pub fn slru_dir_kind(key: &Key) -> Option<Result<SlruKind, u32>> {
  function slru_block_to_key (line 640) | pub fn slru_block_to_key(kind: SlruKind, segno: u32, blknum: BlockNumber...
  function slru_segment_size_to_key (line 656) | pub fn slru_segment_size_to_key(kind: SlruKind, segno: u32) -> Key {
  function slru_segment_key_range (line 686) | pub fn slru_segment_key_range(kind: SlruKind, segno: u32) -> Range<Key> {
  constant TWOPHASEDIR_KEY (line 712) | pub const TWOPHASEDIR_KEY: Key = Key {
  function twophase_file_key (line 722) | pub fn twophase_file_key(xid: u64) -> Key {
  function twophase_key_range (line 734) | pub fn twophase_key_range(xid: u64) -> Range<Key> {
  constant CONTROLFILE_KEY (line 756) | pub const CONTROLFILE_KEY: Key = Key {
  constant CHECKPOINT_KEY (line 765) | pub const CHECKPOINT_KEY: Key = Key {
  constant AUX_FILES_KEY (line 774) | pub const AUX_FILES_KEY: Key = Key {
  function repl_origin_key (line 784) | pub fn repl_origin_key(origin_id: RepOriginId) -> Key {
  function repl_origin_key_range (line 796) | pub fn repl_origin_key_range() -> Range<Key> {
  constant NON_INHERITED_RANGE (line 818) | pub const NON_INHERITED_RANGE: Range<Key> = AUX_FILES_KEY..AUX_FILES_KEY...
  constant SPARSE_RANGE (line 820) | pub const SPARSE_RANGE: Range<Key> = Key::metadata_key_range();
  type ToRelBlockError (line 960) | pub struct ToRelBlockError(u8);
    method fmt (line 963) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function display_fromstr_bijection (line 980) | fn display_fromstr_bijection() {
  function test_metadata_keys (line 996) | fn test_metadata_keys() {
  function test_possible_largest_key (line 1007) | fn test_possible_largest_key() {

FILE: libs/pageserver_api/src/keyspace.rs
  type KeySpace (line 12) | pub struct KeySpace {
    method fmt (line 19) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    method single (line 262) | pub fn single(key_range: Range<Key>) -> Self {
    method partition (line 271) | pub fn partition(
    method is_empty (line 317) | pub fn is_empty(&self) -> bool {
    method merge (line 323) | pub fn merge(&mut self, other: &KeySpace) {
    method remove_overlapping_with (line 351) | pub fn remove_overlapping_with(&mut self, other: &KeySpace) -> KeySpace {
    method start (line 402) | pub fn start(&self) -> Option<Key> {
    method end (line 406) | pub fn end(&self) -> Option<Key> {
    method total_raw_size (line 411) | pub fn total_raw_size(&self) -> usize {
    method overlaps_at (line 418) | fn overlaps_at(&self, range: &Range<Key>) -> Option<usize> {
    method overlaps (line 431) | pub fn overlaps(&self, range: &Range<Key>) -> bool {
    method contains (line 436) | pub fn contains(&self, key: &Key) -> bool {
  type SparseKeySpace (line 30) | pub struct SparseKeySpace(pub KeySpace);
  type ShardedRange (line 42) | pub struct ShardedRange<'a> {
  function contiguous_range_len (line 49) | pub fn contiguous_range_len(range: &Range<Key>) -> u32 {
  function is_contiguous_range (line 68) | pub fn is_contiguous_range(range: &Range<Key>) -> bool {
  function new (line 78) | pub fn new(range: Range<Key>, shard_identity: &'a ShardIdentity) -> Self {
  function fragment (line 87) | pub fn fragment(self, target_nblocks: u32) -> Vec<(u32, Range<Key>)> {
  function page_count (line 168) | pub fn page_count(&self) -> u32 {
  function distance_to_next_boundary (line 213) | fn distance_to_next_boundary(&self, cursor: Key) -> u32 {
  function raw_size (line 251) | pub fn raw_size(range: &Range<Key>) -> u32 {
  type KeyPartitioning (line 449) | pub struct KeyPartitioning {
    method new (line 460) | pub fn new() -> Self {
    method into_sparse (line 465) | pub fn into_sparse(self) -> SparseKeyPartitioning {
  type SparseKeyPartitioning (line 455) | pub struct SparseKeyPartitioning {
    method into_dense (line 475) | pub fn into_dense(self) -> KeyPartitioning {
  type KeySpaceAccum (line 488) | pub struct KeySpaceAccum {
    method new (line 496) | pub fn new() -> Self {
    method add_key (line 505) | pub fn add_key(&mut self, key: Key) {
    method add_range (line 510) | pub fn add_range(&mut self, range: Range<Key>) {
    method to_keyspace (line 530) | pub fn to_keyspace(mut self) -> KeySpace {
    method consume_keyspace (line 539) | pub fn consume_keyspace(&mut self) -> KeySpace {
    method raw_size (line 545) | pub fn raw_size(&self) -> u64 {
  type KeySpaceRandomAccum (line 555) | pub struct KeySpaceRandomAccum {
    method new (line 560) | pub fn new() -> Self {
    method add_key (line 564) | pub fn add_key(&mut self, key: Key) {
    method add_range (line 568) | pub fn add_range(&mut self, range: Range<Key>) {
    method add_keyspace (line 572) | pub fn add_keyspace(&mut self, keyspace: KeySpace) {
    method to_keyspace (line 578) | pub fn to_keyspace(mut self) -> KeySpace {
    method consume_keyspace (line 599) | pub fn consume_keyspace(&mut self) -> KeySpace {
  function singleton_range (line 607) | pub fn singleton_range(key: Key) -> Range<Key> {
  function kr (line 623) | fn kr(irange: Range<i128>) -> Range<Key> {
  function dump_keyspace (line 628) | fn dump_keyspace(ks: &KeySpace) {
  function assert_ks_eq (line 634) | fn assert_ks_eq(actual: &KeySpace, expected: Vec<Range<Key>>) {
  function keyspace_consume (line 651) | fn keyspace_consume() {
  function keyspace_add_range (line 678) | fn keyspace_add_range() {
  function keyspace_overlaps (line 761) | fn keyspace_overlaps() {
  function test_remove_full_overlapps (line 821) | fn test_remove_full_overlapps() {
  function test_remove_partial_overlaps (line 859) | fn test_remove_partial_overlaps() {
  function test_remove_no_overlaps (line 897) | fn test_remove_no_overlaps() {
  function test_remove_one_range_overlaps_multiple (line 928) | fn test_remove_one_range_overlaps_multiple() {
  function sharded_range_relation_gap (line 967) | fn sharded_range_relation_gap() {
  function shard_identity_keyspaces_single_key (line 984) | fn shard_identity_keyspaces_single_key() {
  function contiguous_range_check (line 1001) | fn contiguous_range_check() {
  function shard_identity_keyspaces_forkno_gap (line 1029) | fn shard_identity_keyspaces_forkno_gap() {
  function shard_identity_keyspaces_one_relation (line 1048) | fn shard_identity_keyspaces_one_relation() {
  function do_fragment (line 1077) | fn do_fragment(
  function sharded_range_fragment_simple (line 1135) | fn sharded_range_fragment_simple() {
  function sharded_range_fragment_multi_stripe (line 1180) | fn sharded_range_fragment_multi_stripe() {
  function sharded_range_fragment_starting_from_logical_size (line 1234) | fn sharded_range_fragment_starting_from_logical_size() {
  function sharded_range_fragment_unsharded (line 1274) | fn sharded_range_fragment_unsharded() {
  function sharded_range_fragment_cross_relation (line 1292) | fn sharded_range_fragment_cross_relation() {
  function sharded_range_fragment_tiny_nblocks (line 1313) | fn sharded_range_fragment_tiny_nblocks() {
  function sharded_range_fragment_fuzz (line 1334) | fn sharded_range_fragment_fuzz() {

FILE: libs/pageserver_api/src/models.rs
  type TenantState (line 60) | pub enum TenantState {
    method attachment_status (line 110) | pub fn attachment_status(&self) -> TenantAttachmentStatus {
    method broken_from_reason (line 139) | pub fn broken_from_reason(reason: String) -> Self {
    method fmt (line 149) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type LsnLease (line 163) | pub struct LsnLease {
    constant DEFAULT_LENGTH (line 177) | pub const DEFAULT_LENGTH: Duration = Duration::from_secs(10 * 60);
    constant DEFAULT_LENGTH_FOR_TS (line 181) | pub const DEFAULT_LENGTH_FOR_TS: Duration = Duration::from_secs(60);
    method is_expired (line 184) | pub fn is_expired(&self, now: &SystemTime) -> bool {
  type DetachBehavior (line 193) | pub enum DetachBehavior {
    type Err (line 200) | type Err = &'static str;
    method from_str (line 202) | fn from_str(s: &str) -> Result<Self, Self::Err> {
    method fmt (line 214) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type ActivatingFrom (line 227) | pub enum ActivatingFrom {
  type TimelineState (line 234) | pub enum TimelineState {
  type CompactLsnRange (line 251) | pub struct CompactLsnRange {
    method from (line 266) | fn from(range: Range<Lsn>) -> Self {
    method above (line 296) | pub fn above(lsn: Lsn) -> Self {
  type CompactKeyRange (line 258) | pub struct CompactKeyRange {
    method from (line 275) | fn from(range: Range<Key>) -> Self {
  function from (line 284) | fn from(range: CompactLsnRange) -> Self {
  function from (line 290) | fn from(range: CompactKeyRange) -> Self {
  type CompactInfoResponse (line 305) | pub struct CompactInfoResponse {
  type TimelineCreateRequest (line 314) | pub struct TimelineCreateRequest {
    method mode_tag (line 321) | pub fn mode_tag(&self) -> &'static str {
    method is_import (line 329) | pub fn is_import(&self) -> bool {
  type ShardImportStatus (line 335) | pub enum ShardImportStatus {
    method is_terminal (line 360) | pub fn is_terminal(&self) -> bool {
  type ShardImportProgress (line 342) | pub enum ShardImportProgress {
  type ShardImportProgressV1 (line 347) | pub struct ShardImportProgressV1 {
  type TimelineCreateResponseStorcon (line 370) | pub struct TimelineCreateResponseStorcon {
  type SafekeepersInfo (line 380) | pub struct SafekeepersInfo {
  type SafekeeperInfo (line 388) | pub struct SafekeeperInfo {
  type TimelineCreateRequestMode (line 395) | pub enum TimelineCreateRequestMode {
  type TimelineCreateRequestModeImportPgdata (line 421) | pub struct TimelineCreateRequestModeImportPgdata {
  type ImportPgdataLocation (line 427) | pub enum ImportPgdataLocation {
  type ImportPgdataIdempotencyKey (line 441) | pub struct ImportPgdataIdempotencyKey(pub String);
    method random (line 444) | pub fn random() -> Self {
  type LsnLeaseRequest (line 458) | pub struct LsnLeaseRequest {
  type TenantShardSplitRequest (line 463) | pub struct TenantShardSplitRequest {
  type TenantShardSplitResponse (line 475) | pub struct TenantShardSplitResponse {
  type ShardParameters (line 482) | pub struct ShardParameters {
    method is_unsharded (line 488) | pub fn is_unsharded(&self) -> bool {
    method from (line 503) | fn from(identity: ShardIdentity) -> Self {
  method default (line 494) | fn default() -> Self {
  type FieldPatch (line 512) | pub enum FieldPatch<T> {
  function is_noop (line 520) | fn is_noop(&self) -> bool {
  function apply (line 524) | pub fn apply(self, target: &mut Option<T>) {
  function map (line 532) | pub fn map<U, E, F: FnOnce(T) -> Result<U, E>>(self, map: F) -> Result<F...
  function deserialize (line 542) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  method serialize (line 554) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  type TenantConfigPatch (line 568) | pub struct TenantConfigPatch {
  type TenantConfig (line 657) | pub struct TenantConfig {
    method apply_patch (line 789) | pub fn apply_patch(
    method merge (line 986) | pub fn merge(
  type AuxFilePolicy (line 1124) | pub enum AuxFilePolicy {
  type EvictionPolicy (line 1139) | pub enum EvictionPolicy {
    method discriminant_str (line 1146) | pub fn discriminant_str(&self) -> &'static str {
  type CompactionAlgorithm (line 1167) | pub enum CompactionAlgorithm {
  type ImageCompressionAlgorithm (line 1175) | pub enum ImageCompressionAlgorithm {
  type Err (line 1186) | type Err = anyhow::Error;
  method from_str (line 1187) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  method fmt (line 1210) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type CompactionAlgorithmSettings (line 1225) | pub struct CompactionAlgorithmSettings {
  type L0FlushConfig (line 1231) | pub enum L0FlushConfig {
  type EvictionPolicyLayerAccessThreshold (line 1237) | pub struct EvictionPolicyLayerAccessThreshold {
  type ThrottleConfig (line 1245) | pub struct ThrottleConfig {
    method disabled (line 1285) | pub fn disabled() -> Self {
    method steady_rps (line 1296) | pub fn steady_rps(&self) -> f64 {
  type ThrottleConfigTaskKinds (line 1273) | pub struct ThrottleConfigTaskKinds(Vec<String>);
    method disabled (line 1276) | pub fn disabled() -> Self {
    method is_enabled (line 1279) | pub fn is_enabled(&self) -> bool {
  function test_disabled_is_disabled (line 1306) | fn test_disabled_is_disabled() {
  function test_enabled_backwards_compat (line 1311) | fn test_enabled_backwards_compat() {
  type LocationConfigMode (line 1329) | pub enum LocationConfigMode {
  type LocationConfigSecondary (line 1338) | pub struct LocationConfigSecondary {
  type LocationConfig (line 1345) | pub struct LocationConfig {
  type LocationConfigListResponse (line 1371) | pub struct LocationConfigListResponse {
  type StatusResponse (line 1376) | pub struct StatusResponse {
  type TenantLocationConfigRequest (line 1382) | pub struct TenantLocationConfigRequest {
  type TenantTimeTravelRequest (line 1389) | pub struct TenantTimeTravelRequest {
  type TenantShardLocation (line 1395) | pub struct TenantShardLocation {
  type TenantLocationConfigResponse (line 1402) | pub struct TenantLocationConfigResponse {
  type TenantConfigRequest (line 1410) | pub struct TenantConfigRequest {
    type Target (line 1417) | type Target = TenantConfig;
    method deref (line 1419) | fn deref(&self) -> &Self::Target {
    method new (line 1425) | pub fn new(tenant_id: TenantId) -> TenantConfigRequest {
  type TenantConfigPatchRequest (line 1433) | pub struct TenantConfigPatchRequest {
  type TenantWaitLsnRequest (line 1440) | pub struct TenantWaitLsnRequest {
  type TenantAttachmentStatus (line 1449) | pub enum TenantAttachmentStatus {
  type TenantInfo (line 1456) | pub struct TenantInfo {
  type TenantDetails (line 1474) | pub struct TenantDetails {
  type TimelineArchivalState (line 1484) | pub enum TimelineArchivalState {
  type TimelineVisibilityState (line 1490) | pub enum TimelineVisibilityState {
  type TimelineArchivalConfigRequest (line 1496) | pub struct TimelineArchivalConfigRequest {
  type TimelinePatchIndexPartRequest (line 1501) | pub struct TimelinePatchIndexPartRequest {
  type TimelinesInfoAndOffloaded (line 1511) | pub struct TimelinesInfoAndOffloaded {
  type OffloadedTimelineInfo (line 1518) | pub struct OffloadedTimelineInfo {
  type RelSizeMigration (line 1531) | pub enum RelSizeMigration {
  type TimelineInfo (line 1546) | pub struct TimelineInfo {
  type LayerMapInfo (line 1633) | pub struct LayerMapInfo {
  type LayerResidenceStatus (line 1640) | pub enum LayerResidenceStatus {
  type LayerAccessStats (line 1650) | pub struct LayerAccessStats {
  type InMemoryLayerInfo (line 1662) | pub enum InMemoryLayerInfo {
  type HistoricLayerInfo (line 1669) | pub enum HistoricLayerInfo {
    method layer_file_name (line 1692) | pub fn layer_file_name(&self) -> &str {
    method is_remote (line 1702) | pub fn is_remote(&self) -> bool {
    method set_remote (line 1708) | pub fn set_remote(&mut self, value: bool) {
    method layer_file_size (line 1715) | pub fn layer_file_size(&self) -> u64 {
  type DownloadRemoteLayersTaskSpawnRequest (line 1728) | pub struct DownloadRemoteLayersTaskSpawnRequest {
  type IngestAuxFilesRequest (line 1733) | pub struct IngestAuxFilesRequest {
  type ListAuxFilesRequest (line 1738) | pub struct ListAuxFilesRequest {
  type DownloadRemoteLayersTaskInfo (line 1743) | pub struct DownloadRemoteLayersTaskInfo {
  type DownloadRemoteLayersTaskState (line 1752) | pub enum DownloadRemoteLayersTaskState {
  type TimelineGcRequest (line 1759) | pub struct TimelineGcRequest {
  type WalRedoManagerProcessStatus (line 1764) | pub struct WalRedoManagerProcessStatus {
  type WalRedoManagerStatus (line 1769) | pub struct WalRedoManagerStatus {
  type SecondaryProgress (line 1780) | pub struct SecondaryProgress {
  type TenantScanRemoteStorageShard (line 1796) | pub struct TenantScanRemoteStorageShard {
  type TenantScanRemoteStorageResponse (line 1803) | pub struct TenantScanRemoteStorageResponse {
  type TenantSorting (line 1809) | pub enum TenantSorting {
  method default (line 1821) | fn default() -> Self {
  type TopTenantShardsRequest (line 1827) | pub struct TopTenantShardsRequest {
  type TopTenantShardItem (line 1844) | pub struct TopTenantShardItem {
  type TopTenantShardsResponse (line 1864) | pub struct TopTenantShardsResponse {
  type IoEngineKind (line 1883) | pub enum IoEngineKind {
  type IoMode (line 1905) | pub enum IoMode {
    method preferred (line 1915) | pub fn preferred() -> Self {
    type Error (line 1921) | type Error = u8;
    method try_from (line 1923) | fn try_from(value: u8) -> Result<Self, Self::Error> {
  type ScanDisposableKeysResponse (line 1935) | pub struct ScanDisposableKeysResponse {
  type TenantHistorySize (line 1943) | pub struct TenantHistorySize {
  type PageTraceEvent (line 1952) | pub struct PageTraceEvent {
  method default (line 1959) | fn default() -> Self {
  function test_tenantinfo_serde (line 1977) | fn test_tenantinfo_serde() {
  function test_reject_unknown_field (line 2040) | fn test_reject_unknown_field() {
  function tenantstatus_activating_serde (line 2054) | fn tenantstatus_activating_serde() {
  function tenantstatus_activating_strum (line 2068) | fn tenantstatus_activating_strum() {
  function test_image_compression_algorithm_parsing (line 2107) | fn test_image_compression_algorithm_parsing() {
  function test_tenant_config_patch_request_serde (line 2140) | fn test_tenant_config_patch_request_serde() {

FILE: libs/pageserver_api/src/models/detach_ancestor.rs
  type AncestorDetached (line 6) | pub struct AncestorDetached {

FILE: libs/pageserver_api/src/models/partitioning.rs
  type Partitioning (line 6) | pub struct Partitioning {
    method serialize (line 13) | fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S:...
    method deserialize (line 72) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  type WithDisplay (line 45) | pub struct WithDisplay<'a, T>(&'a T);
  function serialize (line 48) | fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::E...
  type KeyRange (line 56) | pub struct KeyRange<'a>(&'a std::ops::Range<crate::key::Key>);
  function serialize (line 59) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  function test_serialization_roundtrip (line 125) | fn test_serialization_roundtrip() {

FILE: libs/pageserver_api/src/models/utilization.rs
  type PageserverUtilization (line 14) | pub struct PageserverUtilization {
    constant UTILIZATION_FULL (line 58) | const UTILIZATION_FULL: u64 = 1000000;
    method score (line 69) | pub fn score(&self) -> RawScore {
    method cached_score (line 81) | pub fn cached_score(&mut self) -> RawScore {
    method is_overloaded (line 97) | pub fn is_overloaded(score: RawScore) -> bool {
    method adjust_shard_count_max (line 109) | pub fn adjust_shard_count_max(&mut self, shard_count: u32) {
    method full (line 120) | pub fn full() -> Self {
  function unity_percent (line 51) | fn unity_percent() -> Percent {
  type RawScore (line 55) | pub type RawScore = u64;
  constant TEST_DISK_SIZE (line 144) | const TEST_DISK_SIZE: u64 = 1024 * 1024 * 1024 * 1024;
  constant TEST_SHARDS_MAX (line 145) | const TEST_SHARDS_MAX: u32 = 1000;
  function simple (line 151) | pub fn simple(shard_count: u32, disk_wanted_bytes: u64) -> PageserverUti...
  function ser_saturating_u63 (line 171) | fn ser_saturating_u63<S: serde::Serializer>(value: &u64, serializer: S) ...
  function u64_max_is_serialized_as_u63_max (line 186) | fn u64_max_is_serialized_as_u63_max() {

FILE: libs/pageserver_api/src/pagestream_api.rs
  constant BLCKSZ (line 18) | const BLCKSZ: usize = 8192;
  type PagestreamFeMessage (line 22) | pub enum PagestreamFeMessage {
    method serialize (line 236) | pub fn serialize(&self) -> Bytes {
    method parse (line 306) | pub fn parse<R: std::io::Read>(
  type PagestreamBeMessage (line 34) | pub enum PagestreamBeMessage {
    method serialize (line 418) | pub fn serialize(&self, protocol_version: PagestreamProtocolVersion) -...
    method deserialize (line 550) | pub fn deserialize(buf: Bytes) -> anyhow::Result<Self> {
    method kind (line 719) | pub fn kind(&self) -> &'static str {
  type PagestreamFeMessageTag (line 47) | enum PagestreamFeMessageTag {
    type Error (line 75) | type Error = u8;
    method try_from (line 76) | fn try_from(value: u8) -> Result<Self, u8> {
  type PagestreamBeMessageTag (line 61) | enum PagestreamBeMessageTag {
    type Error (line 91) | type Error = u8;
    method try_from (line 92) | fn try_from(value: u8) -> Result<Self, u8> {
  type PagestreamProtocolVersion (line 137) | pub enum PagestreamProtocolVersion {
  type RequestId (line 142) | pub type RequestId = u64;
  type PagestreamRequest (line 145) | pub struct PagestreamRequest {
  type PagestreamExistsRequest (line 152) | pub struct PagestreamExistsRequest {
  type PagestreamNblocksRequest (line 158) | pub struct PagestreamNblocksRequest {
  type PagestreamGetPageRequest (line 164) | pub struct PagestreamGetPageRequest {
  type PagestreamDbSizeRequest (line 171) | pub struct PagestreamDbSizeRequest {
  type PagestreamGetSlruSegmentRequest (line 177) | pub struct PagestreamGetSlruSegmentRequest {
  type PagestreamExistsResponse (line 184) | pub struct PagestreamExistsResponse {
  type PagestreamNblocksResponse (line 190) | pub struct PagestreamNblocksResponse {
  type PagestreamGetPageResponse (line 196) | pub struct PagestreamGetPageResponse {
  type PagestreamGetSlruSegmentResponse (line 202) | pub struct PagestreamGetSlruSegmentResponse {
  type PagestreamErrorResponse (line 208) | pub struct PagestreamErrorResponse {
  type PagestreamDbSizeResponse (line 214) | pub struct PagestreamDbSizeResponse {
  type PagestreamTestRequest (line 221) | pub struct PagestreamTestRequest {
  type PagestreamTestResponse (line 229) | pub struct PagestreamTestResponse {
  function test_pagestream (line 738) | fn test_pagestream() {

FILE: libs/pageserver_api/src/reltag.rs
  type RelTag (line 28) | pub struct RelTag {
    method fmt (line 58) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    type Err (line 82) | type Err = ParseRelTagError;
    method from_str (line 84) | fn from_str(s: &str) -> Result<Self, Self::Err> {
    method to_segfile_name (line 123) | pub fn to_segfile_name(&self, segno: u32) -> String {
    method with_forknum (line 145) | pub fn with_forknum(&self, forknum: u8) -> Self {
  type BlockNumber (line 36) | pub type BlockNumber = u32;
  method partial_cmp (line 39) | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
  method cmp (line 45) | fn cmp(&self, other: &Self) -> Ordering {
  type ParseRelTagError (line 72) | pub enum ParseRelTagError {
  type SlruKind (line 181) | pub enum SlruKind {
    method fmt (line 188) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: libs/pageserver_api/src/shard.rs
  type ShardIdentity (line 48) | pub struct ShardIdentity {
    method unsharded (line 100) | pub const fn unsharded() -> Self {
    method unsharded_with_stripe_size (line 111) | pub fn unsharded_with_stripe_size(stripe_size: ShardStripeSize) -> Self {
    method broken (line 126) | pub fn broken(number: ShardNumber, count: ShardCount) -> Self {
    method is_unsharded (line 138) | pub fn is_unsharded(&self) -> bool {
    method new (line 144) | pub fn new(
    method from_params (line 167) | pub fn from_params(number: ShardNumber, params: ShardParameters) -> Se...
    method assert_equal (line 178) | pub fn assert_equal(&self, other: ShardIdentity) {
    method is_broken (line 187) | fn is_broken(&self) -> bool {
    method get_shard_number (line 191) | pub fn get_shard_number(&self, key: &Key) -> ShardNumber {
    method is_key_local (line 200) | pub fn is_key_local(&self, key: &Key) -> bool {
    method is_key_global (line 210) | pub fn is_key_global(&self, key: &Key) -> bool {
    method is_key_disposable (line 237) | pub fn is_key_disposable(&self, key: &Key) -> bool {
    method shard_index (line 251) | pub fn shard_index(&self) -> ShardIndex {
    method shard_slug (line 258) | pub fn shard_slug(&self) -> String {
    method is_shard_zero (line 268) | pub fn is_shard_zero(&self) -> bool {
  method hash (line 59) | fn hash<H: Hasher>(&self, state: &mut H) {
  type ShardLayout (line 74) | pub struct ShardLayout(u8);
  constant LAYOUT_V1 (line 76) | const LAYOUT_V1: ShardLayout = ShardLayout(1);
  constant LAYOUT_BROKEN (line 78) | const LAYOUT_BROKEN: ShardLayout = ShardLayout(255);
  constant DEFAULT_STRIPE_SIZE (line 84) | pub const DEFAULT_STRIPE_SIZE: ShardStripeSize = ShardStripeSize(16 * 10...
  type ShardConfigError (line 87) | pub enum ShardConfigError {
  function key_is_shard0 (line 275) | fn key_is_shard0(key: &Key) -> bool {
  function murmurhash32 (line 290) | fn murmurhash32(mut h: u32) -> u32 {
  function hash_combine (line 300) | fn hash_combine(mut a: u32, mut b: u32) -> u32 {
  function key_to_shard_number (line 319) | pub fn key_to_shard_number(
  type KeyShardingInfo (line 340) | struct KeyShardingInfo {
  function describe (line 345) | pub fn describe(
  constant EXAMPLE_TENANT_ID (line 365) | const EXAMPLE_TENANT_ID: &str = "1f359dd625e519a1a4e8d7509690f6fc";
  function tenant_shard_id_string (line 368) | fn tenant_shard_id_string() -> Result<(), hex::FromHexError> {
  function tenant_shard_id_binary (line 388) | fn tenant_shard_id_binary() -> Result<(), hex::FromHexError> {
  function tenant_shard_id_backward_compat (line 410) | fn tenant_shard_id_backward_compat() -> Result<(), hex::FromHexError> {
  function tenant_shard_id_forward_compat (line 428) | fn tenant_shard_id_forward_compat() -> Result<(), hex::FromHexError> {
  function tenant_shard_id_legacy_binary (line 445) | fn tenant_shard_id_legacy_binary() -> Result<(), hex::FromHexError> {
  function shard_identity_validation (line 467) | fn shard_identity_validation() -> Result<(), ShardConfigError> {
  function shard_index_human_encoding (line 498) | fn shard_index_human_encoding() -> Result<(), hex::FromHexError> {
  function shard_index_binary_encoding (line 513) | fn shard_index_binary_encoding() -> Result<(), hex::FromHexError> {
  function murmur_hash (line 532) | fn murmur_hash() {
  function shard_mapping (line 539) | fn shard_mapping() {
  function shard_id_split (line 554) | fn shard_id_split() {

FILE: libs/pageserver_api/src/upcall_api.rs
  type ReAttachRequest (line 17) | pub struct ReAttachRequest {
  type ReAttachResponseTenant (line 35) | pub struct ReAttachResponseTenant {
  type ReAttachResponse (line 43) | pub struct ReAttachResponse {
  type ValidateRequestTenant (line 48) | pub struct ValidateRequestTenant {
  type ValidateRequest (line 54) | pub struct ValidateRequest {
  type ValidateResponse (line 59) | pub struct ValidateResponse {
  type ValidateResponseTenant (line 64) | pub struct ValidateResponseTenant {
  type TimelineImportStatusRequest (line 70) | pub struct TimelineImportStatusRequest {
  type PutTimelineImportStatusRequest (line 77) | pub struct PutTimelineImportStatusRequest {

FILE: libs/postgres_backend/src/lib.rs
  type QueryError (line 32) | pub enum QueryError {
    method from (line 56) | fn from(e: io::Error) -> Self {
    method pg_error_code (line 62) | pub fn pg_error_code(&self) -> &'static [u8; 5] {
  function is_expected_io_error (line 77) | pub fn is_expected_io_error(e: &io::Error) -> bool {
  type Handler (line 91) | pub trait Handler<IO> {
    method process_query (line 96) | fn process_query(
    method startup (line 107) | fn startup(
    method check_auth_jwt (line 116) | fn check_auth_jwt(
  type ProtoState (line 128) | pub enum ProtoState {
  type ProcessMsgResult (line 141) | pub enum ProcessMsgResult {
  type MaybeTlsStream (line 147) | pub enum MaybeTlsStream<IO> {
  method poll_write (line 153) | fn poll_write(
  method poll_flush (line 163) | fn poll_flush(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> ...
  method poll_shutdown (line 169) | fn poll_shutdown(
  method poll_read (line 180) | fn poll_read(
  type AuthType (line 193) | pub enum AuthType {
    method fmt (line 212) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Err (line 200) | type Err = anyhow::Error;
  method from_str (line 202) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  type MaybeWriteOnly (line 224) | enum MaybeWriteOnly<IO> {
  function read_startup_message (line 231) | async fn read_startup_message(&mut self) -> Result<Option<FeStartupPacke...
  function read_message (line 241) | async fn read_message(&mut self) -> Result<Option<FeMessage>, Connection...
  function write_message_noflush (line 251) | fn write_message_noflush(&mut self, msg: &BeMessage<'_>) -> Result<(), P...
  function flush (line 259) | async fn flush(&mut self) -> io::Result<()> {
  function shutdown (line 268) | async fn shutdown(&mut self) -> io::Result<()> {
  type PostgresBackend (line 277) | pub struct PostgresBackend<IO> {
  type PostgresBackendTCP (line 289) | pub type PostgresBackendTCP = PostgresBackend<tokio::net::TcpStream>;
  function cstr_to_str (line 292) | fn cstr_to_str(bytes: &[u8]) -> anyhow::Result<&str> {
  function new (line 298) | pub fn new(
  function new_from_io (line 319) | pub fn new_from_io(
  function get_peer_addr (line 338) | pub fn get_peer_addr(&self) -> &SocketAddr {
  function read_message (line 344) | pub async fn read_message(&mut self) -> Result<Option<FeMessage>, Connec...
  function write_message_noflush (line 365) | pub fn write_message_noflush(
  function flush (line 375) | pub async fn flush(&mut self) -> io::Result<()> {
  function poll_flush (line 380) | pub fn poll_flush(
  function write_message (line 389) | pub async fn write_message(
  function copyout_writer (line 402) | pub fn copyout_writer(&mut self) -> CopyDataWriter<IO> {
  function run (line 407) | pub async fn run(
  function run_message_loop (line 445) | async fn run_message_loop(
  function tls_upgrade (line 512) | async fn tls_upgrade(
  function start_tls (line 528) | async fn start_tls(&mut self) -> anyhow::Result<()> {
  function split (line 553) | pub fn split(&mut self) -> anyhow::Result<PostgresBackendReader<IO>> {
  function unsplit (line 572) | pub fn unsplit(&mut self, reader: PostgresBackendReader<IO>) -> anyhow::...
  function handshake (line 593) | async fn handshake(&mut self, handler: &mut impl Handler<IO>) -> Result<...
  function process_startup_message (line 661) | async fn process_startup_message(
  function process_message (line 734) | async fn process_message(
  function handle_copy_stream_end (line 856) | pub async fn handle_copy_stream_end(&mut self, end: CopyStreamHandlerEnd) {
  type PostgresBackendReader (line 926) | pub struct PostgresBackendReader<IO> {
  function read_message (line 934) | pub async fn read_message(&mut self) -> Result<Option<FeMessage>, Connec...
  function read_copy_message (line 951) | pub async fn read_copy_message(&mut self) -> Result<Bytes, CopyStreamHan...
  type CopyDataWriter (line 971) | pub struct CopyDataWriter<'a, IO> {
  method poll_write (line 976) | fn poll_write(
  method poll_flush (line 1003) | fn poll_flush(
  method poll_shutdown (line 1011) | fn poll_shutdown(
  function short_error (line 1020) | pub fn short_error(e: &QueryError) -> String {
  function log_query_error (line 1032) | fn log_query_error(query: &str, e: &QueryError) {
  type CopyStreamHandlerEnd (line 1071) | pub enum CopyStreamHandlerEnd {

FILE: libs/postgres_backend/tests/simple_select.rs
  function make_tcp_pair (line 18) | async fn make_tcp_pair() -> (TcpStream, TcpStream) {
  type TestHandler (line 26) | struct TestHandler {}
    method process_query (line 30) | async fn process_query(
  function simple_select (line 46) | async fn simple_select() {
  function simple_select_ssl (line 94) | async fn simple_select_ssl() {

FILE: libs/postgres_connection/src/lib.rs
  function parse_host_port (line 14) | pub fn parse_host_port<S: AsRef<str>>(host_port: S) -> Result<(Host, Opt...
  function test_normal (line 38) | fn test_normal() {
  function test_no_port (line 45) | fn test_no_port() {
  function test_ipv6 (line 52) | fn test_ipv6() {
  function test_invalid_host (line 59) | fn test_invalid_host() {
  function test_invalid_port (line 64) | fn test_invalid_port() {
  type PgConnectionConfig (line 70) | pub struct PgConnectionConfig {
    method new_host_port (line 82) | pub fn new_host_port(host: Host, port: u16) -> Self {
    method host (line 91) | pub fn host(&self) -> &Host {
    method port (line 95) | pub fn port(&self) -> u16 {
    method set_host (line 99) | pub fn set_host(mut self, h: Host) -> Self {
    method set_port (line 104) | pub fn set_port(mut self, p: u16) -> Self {
    method set_password (line 109) | pub fn set_password(mut self, s: Option<String>) -> Self {
    method extend_options (line 114) | pub fn extend_options<I: IntoIterator<Item = S>, S: Into<String>>(mut ...
    method raw_address (line 120) | pub fn raw_address(&self) -> String {
    method to_tokio_postgres_config (line 127) | pub fn to_tokio_postgres_config(&self) -> tokio_postgres::Config {
    method connect_no_tls (line 169) | pub async fn connect_no_tls(
    method fmt (line 185) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
    method fmt (line 192) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  function test_no_password (line 220) | fn test_no_password() {
  function test_ipv6 (line 232) | fn test_ipv6() {
  function test_with_password (line 248) | fn test_with_password() {
  function test_with_options (line 261) | fn test_with_options() {

FILE: libs/postgres_ffi/benches/waldecoder.rs
  constant KB (line 11) | const KB: usize = 1024;
  function bench_complete_record (line 22) | fn bench_complete_record(c: &mut Criterion) {

FILE: libs/postgres_ffi/build.rs
  type PostgresFfiCallbacks (line 11) | struct PostgresFfiCallbacks;
  method include_file (line 14) | fn include_file(&self, filename: &str) {
  method add_derives (line 23) | fn add_derives(&self, derive_info: &DeriveInfo) -> Vec<String> {
  function main (line 46) | fn main() -> anyhow::Result<()> {

FILE: libs/postgres_ffi/src/controlfile_utils.rs
  constant SIZEOF_CONTROLDATA (line 32) | const SIZEOF_CONTROLDATA: usize = size_of::<ControlFileData>();
  method pg_control_crc_offset (line 37) | const fn pg_control_crc_offset() -> usize {
  method decode (line 44) | pub fn decode(buf: &[u8]) -> Result<ControlFileData> {
  method encode (line 78) | pub fn encode(&self) -> Bytes {

FILE: libs/postgres_ffi/src/lib.rs
  constant BLCKSZ (line 240) | pub const BLCKSZ: u16 = 8192;
  constant RELSEG_SIZE (line 241) | pub const RELSEG_SIZE: u32 = 1024 * 1024 * 1024 / (BLCKSZ as u32);
  constant XLOG_BLCKSZ (line 242) | pub const XLOG_BLCKSZ: usize = 8192;
  constant WAL_SEGMENT_SIZE (line 243) | pub const WAL_SEGMENT_SIZE: usize = 16 * 1024 * 1024;
  constant MAX_SEND_SIZE (line 245) | pub const MAX_SEND_SIZE: usize = XLOG_BLCKSZ * 16;
  function bkpimage_is_compressed (line 254) | pub fn bkpimage_is_compressed(bimg_info: u8, version: PgMajorVersion) ->...
  function generate_wal_segment (line 258) | pub fn generate_wal_segment(
  function generate_pg_control (line 272) | pub fn generate_pg_control(
  constant PG_TLI (line 292) | pub const PG_TLI: u32 = 1;
  function transaction_id_is_normal (line 295) | pub const fn transaction_id_is_normal(id: TransactionId) -> bool {
  function transaction_id_precedes (line 300) | pub const fn transaction_id_precedes(id1: TransactionId, id2: Transactio...
  function page_is_new (line 315) | pub fn page_is_new(pg: &[u8]) -> bool {
  function page_get_lsn (line 320) | pub fn page_get_lsn(pg: &[u8]) -> Lsn {
  function page_set_lsn (line 327) | pub fn page_set_lsn(pg: &mut [u8], lsn: Lsn) {
  function fsm_logical_to_physical (line 335) | pub fn fsm_logical_to_physical(addr: BlockNumber) -> BlockNumber {
  type State (line 361) | pub enum State {
  type WalStreamDecoder (line 372) | pub struct WalStreamDecoder {
    method new (line 387) | pub fn new(lsn: Lsn, pg_version: PgMajorVersion) -> WalStreamDecoder {
    method available (line 397) | pub fn available(&self) -> Lsn {
    method lsn (line 405) | pub fn lsn(&self) -> Lsn {
    method feed_bytes (line 409) | pub fn feed_bytes(&mut self, buf: &[u8]) {
    method poll_decode (line 413) | pub fn poll_decode(&mut self) -> Result<Option<(Lsn, Bytes)>, WalDecod...
  type WalDecodeError (line 381) | pub struct WalDecodeError {

FILE: libs/postgres_ffi/src/nonrelfile_utils.rs
  function transaction_id_set_status (line 10) | pub fn transaction_id_set_status(xid: u32, status: u8, page: &mut BytesM...
  function transaction_id_get_status (line 26) | pub fn transaction_id_get_status(xid: u32, page: &[u8]) -> u8 {
  function clogpage_precedes (line 37) | pub const fn clogpage_precedes(page1: u32, page2: u32) -> bool {
  function slru_may_delete_clogsegment (line 48) | pub fn slru_may_delete_clogsegment(segpage: u32, cutoff_page: u32) -> bo...
  function mx_offset_to_flags_offset (line 58) | pub fn mx_offset_to_flags_offset(xid: MultiXactId) -> usize {
  function mx_offset_to_flags_bitshift (line 64) | pub fn mx_offset_to_flags_bitshift(xid: MultiXactId) -> u16 {
  function mx_offset_to_member_offset (line 70) | pub fn mx_offset_to_member_offset(xid: MultiXactId) -> usize {
  function mx_offset_to_member_page (line 76) | fn mx_offset_to_member_page(xid: u32) -> u32 {
  function mx_offset_to_member_segment (line 80) | pub fn mx_offset_to_member_segment(xid: u32) -> i32 {
  function test_multixid_calc (line 89) | fn test_multixid_calc() {

FILE: libs/postgres_ffi/src/pg_constants.rs
  constant XLOG_SMGR_CREATE (line 17) | pub const XLOG_SMGR_CREATE: u8 = 0x10;
  constant XLOG_SMGR_TRUNCATE (line 18) | pub const XLOG_SMGR_TRUNCATE: u8 = 0x20;
  constant SMGR_TRUNCATE_HEAP (line 20) | pub const SMGR_TRUNCATE_HEAP: u32 = 0x0001;
  constant SMGR_TRUNCATE_VM (line 21) | pub const SMGR_TRUNCATE_VM: u32 = 0x0002;
  constant SMGR_TRUNCATE_FSM (line 22) | pub const SMGR_TRUNCATE_FSM: u32 = 0x0004;
  constant SIZEOF_PAGE_HEADER_DATA (line 29) | const SIZEOF_PAGE_HEADER_DATA: usize = size_of::<PageHeaderData>();
  constant MAXALIGN_SIZE_OF_PAGE_HEADER_DATA (line 30) | pub const MAXALIGN_SIZE_OF_PAGE_HEADER_DATA: usize = (SIZEOF_PAGE_HEADER...
  constant CLOG_XACTS_PER_BYTE (line 35) | pub const CLOG_XACTS_PER_BYTE: u32 = 4;
  constant CLOG_XACTS_PER_PAGE (line 36) | pub const CLOG_XACTS_PER_PAGE: u32 = BLCKSZ as u32 * CLOG_XACTS_PER_BYTE;
  constant CLOG_BITS_PER_XACT (line 37) | pub const CLOG_BITS_PER_XACT: u8 = 2;
  constant CLOG_XACT_BITMASK (line 38) | pub const CLOG_XACT_BITMASK: u8 = (1 << CLOG_BITS_PER_XACT) - 1;
  constant TRANSACTION_STATUS_COMMITTED (line 40) | pub const TRANSACTION_STATUS_COMMITTED: u8 = 0x01;
  constant TRANSACTION_STATUS_ABORTED (line 41) | pub const TRANSACTION_STATUS_ABORTED: u8 = 0x02;
  constant TRANSACTION_STATUS_SUB_COMMITTED (line 42) | pub const TRANSACTION_STATUS_SUB_COMMITTED: u8 = 0x03;
  constant CLOG_ZEROPAGE (line 44) | pub const CLOG_ZEROPAGE: u8 = 0x00;
  constant CLOG_TRUNCATE (line 45) | pub const CLOG_TRUNCATE: u8 = 0x10;
  constant SIZE_OF_PAGE_HEADER (line 50) | pub const SIZE_OF_PAGE_HEADER: u16 = 24;
  constant BITS_PER_BYTE (line 51) | pub const BITS_PER_BYTE: u16 = 8;
  constant HEAPBLOCKS_PER_PAGE (line 52) | pub const HEAPBLOCKS_PER_PAGE: u32 =
  constant HEAPBLOCKS_PER_BYTE (line 54) | pub const HEAPBLOCKS_PER_BYTE: u16 = BITS_PER_BYTE / BITS_PER_HEAPBLOCK;
  function HEAPBLK_TO_MAPBLOCK (line 56) | pub const fn HEAPBLK_TO_MAPBLOCK(x: u32) -> u32 {
  function HEAPBLK_TO_MAPBYTE (line 59) | pub const fn HEAPBLK_TO_MAPBYTE(x: u32) -> u32 {
  function HEAPBLK_TO_OFFSET (line 62) | pub const fn HEAPBLK_TO_OFFSET(x: u32) -> u32 {
  constant BITS_PER_HEAPBLOCK (line 66) | pub const BITS_PER_HEAPBLOCK: u16 = 2;
  constant VISIBILITYMAP_ALL_VISIBLE (line 67) | pub const VISIBILITYMAP_ALL_VISIBLE: u8 = 0x01;
  constant VISIBILITYMAP_ALL_FROZEN (line 68) | pub const VISIBILITYMAP_ALL_FROZEN: u8 = 0x02;
  constant VISIBILITYMAP_VALID_BITS (line 69) | pub const VISIBILITYMAP_VALID_BITS: u8 = 0x03;
  constant XLOG_XACT_COMMIT (line 72) | pub const XLOG_XACT_COMMIT: u8 = 0x00;
  constant XLOG_XACT_PREPARE (line 73) | pub const XLOG_XACT_PREPARE: u8 = 0x10;
  constant XLOG_XACT_ABORT (line 74) | pub const XLOG_XACT_ABORT: u8 = 0x20;
  constant XLOG_XACT_COMMIT_PREPARED (line 75) | pub const XLOG_XACT_COMMIT_PREPARED: u8 = 0x30;
  constant XLOG_XACT_ABORT_PREPARED (line 76) | pub const XLOG_XACT_ABORT_PREPARED: u8 = 0x40;
  constant XLOG_RUNNING_XACTS (line 79) | pub const XLOG_RUNNING_XACTS: u8 = 0x10;
  constant SLRU_PAGES_PER_SEGMENT (line 82) | pub const SLRU_PAGES_PER_SEGMENT: u32 = 32;
  constant SLRU_SEG_SIZE (line 83) | pub const SLRU_SEG_SIZE: usize = BLCKSZ as usize * SLRU_PAGES_PER_SEGMEN...
  constant XLOG_XACT_OPMASK (line 86) | pub const XLOG_XACT_OPMASK: u8 = 0x70;
  constant XLOG_HEAP_OPMASK (line 87) | pub const XLOG_HEAP_OPMASK: u8 = 0x70;
  constant XLOG_XACT_HAS_INFO (line 89) | pub const XLOG_XACT_HAS_INFO: u8 = 0x80;
  constant XACT_XINFO_HAS_DBINFO (line 95) | pub const XACT_XINFO_HAS_DBINFO: u32 = 1u32 << 0;
  constant XACT_XINFO_HAS_SUBXACTS (line 96) | pub const XACT_XINFO_HAS_SUBXACTS: u32 = 1u32 << 1;
  constant XACT_XINFO_HAS_RELFILENODES (line 97) | pub const XACT_XINFO_HAS_RELFILENODES: u32 = 1u32 << 2;
  constant XACT_XINFO_HAS_INVALS (line 98) | pub const XACT_XINFO_HAS_INVALS: u32 = 1u32 << 3;
  constant XACT_XINFO_HAS_TWOPHASE (line 99) | pub const XACT_XINFO_HAS_TWOPHASE: u32 = 1u32 << 4;
  constant XACT_XINFO_HAS_ORIGIN (line 100) | pub const XACT_XINFO_HAS_ORIGIN: u32 = 1u32 << 5;
  constant XLOG_NEXTOID (line 105) | pub const XLOG_NEXTOID: u8 = 0x30;
  constant XLOG_SWITCH (line 106) | pub const XLOG_SWITCH: u8 = 0x40;
  constant XLOG_FPI_FOR_HINT (line 107) | pub const XLOG_FPI_FOR_HINT: u8 = 0xA0;
  constant XLOG_FPI (line 108) | pub const XLOG_FPI: u8 = 0xB0;
  constant FIRST_MULTIXACT_ID (line 111) | pub const FIRST_MULTIXACT_ID: u32 = 1;
  constant MAX_MULTIXACT_ID (line 112) | pub const MAX_MULTIXACT_ID: u32 = 0xFFFFFFFF;
  constant MAX_MULTIXACT_OFFSET (line 113) | pub const MAX_MULTIXACT_OFFSET: u32 = 0xFFFFFFFF;
  constant XLOG_MULTIXACT_ZERO_OFF_PAGE (line 115) | pub const XLOG_MULTIXACT_ZERO_OFF_PAGE: u8 = 0x00;
  constant XLOG_MULTIXACT_ZERO_MEM_PAGE (line 116) | pub const XLOG_MULTIXACT_ZERO_MEM_PAGE: u8 = 0x10;
  constant XLOG_MULTIXACT_CREATE_ID (line 117) | pub const XLOG_MULTIXACT_CREATE_ID: u8 = 0x20;
  constant XLOG_MULTIXACT_TRUNCATE_ID (line 118) | pub const XLOG_MULTIXACT_TRUNCATE_ID: u8 = 0x30;
  constant MULTIXACT_OFFSETS_PER_PAGE (line 120) | pub const MULTIXACT_OFFSETS_PER_PAGE: u16 = BLCKSZ / 4;
  constant MXACT_MEMBER_BITS_PER_XACT (line 121) | pub const MXACT_MEMBER_BITS_PER_XACT: u16 = 8;
  constant MXACT_MEMBER_FLAGS_PER_BYTE (line 122) | pub const MXACT_MEMBER_FLAGS_PER_BYTE: u16 = 1;
  constant MULTIXACT_FLAGBYTES_PER_GROUP (line 123) | pub const MULTIXACT_FLAGBYTES_PER_GROUP: u16 = 4;
  constant MULTIXACT_MEMBERS_PER_MEMBERGROUP (line 124) | pub const MULTIXACT_MEMBERS_PER_MEMBERGROUP: u16 =
  constant MULTIXACT_MEMBERGROUP_SIZE (line 127) | pub const MULTIXACT_MEMBERGROUP_SIZE: u16 =
  constant MULTIXACT_MEMBERGROUPS_PER_PAGE (line 129) | pub const MULTIXACT_MEMBERGROUPS_PER_PAGE: u16 = BLCKSZ / MULTIXACT_MEMB...
  constant MULTIXACT_MEMBERS_PER_PAGE (line 130) | pub const MULTIXACT_MEMBERS_PER_PAGE: u16 =
  constant XLOG_HEAP_INSERT (line 134) | pub const XLOG_HEAP_INSERT: u8 = 0x00;
  constant XLOG_HEAP_DELETE (line 135) | pub const XLOG_HEAP_DELETE: u8 = 0x10;
  constant XLOG_HEAP_UPDATE (line 136) | pub const XLOG_HEAP_UPDATE: u8 = 0x20;
  constant XLOG_HEAP_HOT_UPDATE (line 137) | pub const XLOG_HEAP_HOT_UPDATE: u8 = 0x40;
  constant XLOG_HEAP_LOCK (line 138) | pub const XLOG_HEAP_LOCK: u8 = 0x60;
  constant XLOG_HEAP_INIT_PAGE (line 139) | pub const XLOG_HEAP_INIT_PAGE: u8 = 0x80;
  constant XLOG_HEAP2_VISIBLE (line 140) | pub const XLOG_HEAP2_VISIBLE: u8 = 0x40;
  constant XLOG_HEAP2_MULTI_INSERT (line 141) | pub const XLOG_HEAP2_MULTI_INSERT: u8 = 0x50;
  constant XLOG_HEAP2_LOCK_UPDATED (line 142) | pub const XLOG_HEAP2_LOCK_UPDATED: u8 = 0x60;
  constant XLH_LOCK_ALL_FROZEN_CLEARED (line 143) | pub const XLH_LOCK_ALL_FROZEN_CLEARED: u8 = 0x01;
  constant XLH_INSERT_ALL_FROZEN_SET (line 144) | pub const XLH_INSERT_ALL_FROZEN_SET: u8 = (1 << 5) as u8;
  constant XLH_INSERT_ALL_VISIBLE_CLEARED (line 145) | pub const XLH_INSERT_ALL_VISIBLE_CLEARED: u8 = (1 << 0) as u8;
  constant XLH_UPDATE_OLD_ALL_VISIBLE_CLEARED (line 146) | pub const XLH_UPDATE_OLD_ALL_VISIBLE_CLEARED: u8 = (1 << 0) as u8;
  constant XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED (line 147) | pub const XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED: u8 = (1 << 1) as u8;
  constant XLH_DELETE_ALL_VISIBLE_CLEARED (line 148) | pub const XLH_DELETE_ALL_VISIBLE_CLEARED: u8 = (1 << 0) as u8;
  constant XLOG_HEAP2_REWRITE (line 151) | pub const XLOG_HEAP2_REWRITE: u8 = 0x00;
  constant XLOG_LOGICAL_MESSAGE (line 154) | pub const XLOG_LOGICAL_MESSAGE: u8 = 0x00;
  constant RM_XLOG_ID (line 157) | pub const RM_XLOG_ID: u8 = 0;
  constant RM_XACT_ID (line 158) | pub const RM_XACT_ID: u8 = 1;
  constant RM_SMGR_ID (line 159) | pub const RM_SMGR_ID: u8 = 2;
  constant RM_CLOG_ID (line 160) | pub const RM_CLOG_ID: u8 = 3;
  constant RM_DBASE_ID (line 161) | pub const RM_DBASE_ID: u8 = 4;
  constant RM_TBLSPC_ID (line 162) | pub const RM_TBLSPC_ID: u8 = 5;
  constant RM_MULTIXACT_ID (line 163) | pub const RM_MULTIXACT_ID: u8 = 6;
  constant RM_RELMAP_ID (line 164) | pub const RM_RELMAP_ID: u8 = 7;
  constant RM_STANDBY_ID (line 165) | pub const RM_STANDBY_ID: u8 = 8;
  constant RM_HEAP2_ID (line 166) | pub const RM_HEAP2_ID: u8 = 9;
  constant RM_HEAP_ID (line 167) | pub const RM_HEAP_ID: u8 = 10;
  constant RM_REPLORIGIN_ID (line 168) | pub const RM_REPLORIGIN_ID: u8 = 19;
  constant RM_LOGICALMSG_ID (line 169) | pub const RM_LOGICALMSG_ID: u8 = 21;
  constant RM_NEON_ID (line 172) | pub const RM_NEON_ID: u8 = 134;
  constant XLOG_NEON_HEAP_INIT_PAGE (line 174) | pub const XLOG_NEON_HEAP_INIT_PAGE: u8 = 0x80;
  constant XLOG_NEON_HEAP_INSERT (line 176) | pub const XLOG_NEON_HEAP_INSERT: u8 = 0x00;
  constant XLOG_NEON_HEAP_DELETE (line 177) | pub const XLOG_NEON_HEAP_DELETE: u8 = 0x10;
  constant XLOG_NEON_HEAP_UPDATE (line 178) | pub const XLOG_NEON_HEAP_UPDATE: u8 = 0x20;
  constant XLOG_NEON_HEAP_HOT_UPDATE (line 179) | pub const XLOG_NEON_HEAP_HOT_UPDATE: u8 = 0x30;
  constant XLOG_NEON_HEAP_LOCK (line 180) | pub const XLOG_NEON_HEAP_LOCK: u8 = 0x40;
  constant XLOG_NEON_HEAP_MULTI_INSERT (line 181) | pub const XLOG_NEON_HEAP_MULTI_INSERT: u8 = 0x50;
  constant XLOG_NEON_HEAP_VISIBLE (line 183) | pub const XLOG_NEON_HEAP_VISIBLE: u8 = 0x40;
  constant XLR_INFO_MASK (line 186) | pub const XLR_INFO_MASK: u8 = 0x0F;
  constant XLR_RMGR_INFO_MASK (line 187) | pub const XLR_RMGR_INFO_MASK: u8 = 0xF0;
  constant XLOG_TBLSPC_CREATE (line 189) | pub const XLOG_TBLSPC_CREATE: u8 = 0x00;
  constant XLOG_TBLSPC_DROP (line 190) | pub const XLOG_TBLSPC_DROP: u8 = 0x10;
  constant XLR_MAX_BLOCK_ID (line 195) | pub const XLR_MAX_BLOCK_ID: u8 = 32;
  constant XLR_BLOCK_ID_DATA_SHORT (line 197) | pub const XLR_BLOCK_ID_DATA_SHORT: u8 = 255;
  constant XLR_BLOCK_ID_DATA_LONG (line 198) | pub const XLR_BLOCK_ID_DATA_LONG: u8 = 254;
  constant XLR_BLOCK_ID_ORIGIN (line 199) | pub const XLR_BLOCK_ID_ORIGIN: u8 = 253;
  constant XLR_BLOCK_ID_TOPLEVEL_XID (line 200) | pub const XLR_BLOCK_ID_TOPLEVEL_XID: u8 = 252;
  constant BKPBLOCK_FORK_MASK (line 202) | pub const BKPBLOCK_FORK_MASK: u8 = 0x0F;
  constant _BKPBLOCK_FLAG_MASK (line 203) | pub const _BKPBLOCK_FLAG_MASK: u8 = 0xF0;
  constant BKPBLOCK_HAS_IMAGE (line 204) | pub const BKPBLOCK_HAS_IMAGE: u8 = 0x10;
  constant BKPBLOCK_HAS_DATA (line 205) | pub const BKPBLOCK_HAS_DATA: u8 = 0x20;
  constant BKPBLOCK_WILL_INIT (line 206) | pub const BKPBLOCK_WILL_INIT: u8 = 0x40;
  constant BKPBLOCK_SAME_REL (line 207) | pub const BKPBLOCK_SAME_REL: u8 = 0x80;
  constant BKPIMAGE_HAS_HOLE (line 210) | pub const BKPIMAGE_HAS_HOLE: u8 = 0x01;
  constant FIRST_NORMAL_TRANSACTION_ID (line 213) | pub const FIRST_NORMAL_TRANSACTION_ID: u32 = 3;
  constant INVALID_TRANSACTION_ID (line 214) | pub const INVALID_TRANSACTION_ID: u32 = 0;
  constant XLOG_CHECKPOINT_SHUTDOWN (line 217) | pub const XLOG_CHECKPOINT_SHUTDOWN: u8 = 0x00;
  constant XLOG_CHECKPOINT_ONLINE (line 218) | pub const XLOG_CHECKPOINT_ONLINE: u8 = 0x10;
  constant XLOG_PARAMETER_CHANGE (line 219) | pub const XLOG_PARAMETER_CHANGE: u8 = 0x60;
  constant XLOG_END_OF_RECOVERY (line 220) | pub const XLOG_END_OF_RECOVERY: u8 = 0x90;
  constant XLOG_REPLORIGIN_SET (line 223) | pub const XLOG_REPLORIGIN_SET: u8 = 0x00;
  constant XLOG_REPLORIGIN_DROP (line 224) | pub const XLOG_REPLORIGIN_DROP: u8 = 0x10;
  constant XLP_FIRST_IS_CONTRECORD (line 227) | pub const XLP_FIRST_IS_CONTRECORD: u16 = 0x0001;
  constant XLP_LONG_HEADER (line 228) | pub const XLP_LONG_HEADER: u16 = 0x0002;
  constant REPL_SLOT_ON_DISK_OFFSETOF_RESTART_LSN (line 231) | pub const REPL_SLOT_ON_DISK_OFFSETOF_RESTART_LSN: usize = 4*4  /* offset...
  constant FSM_NODES_PER_PAGE (line 235) | const FSM_NODES_PER_PAGE: usize = BLCKSZ as usize - SIZEOF_PAGE_HEADER_D...
  constant FSM_NON_LEAF_NODES_PER_PAGE (line 236) | const FSM_NON_LEAF_NODES_PER_PAGE: usize = BLCKSZ as usize / 2 - 1;
  constant FSM_LEAF_NODES_PER_PAGE (line 237) | const FSM_LEAF_NODES_PER_PAGE: usize = FSM_NODES_PER_PAGE - FSM_NON_LEAF...
  constant SLOTS_PER_FSM_PAGE (line 238) | pub const SLOTS_PER_FSM_PAGE: u32 = FSM_LEAF_NODES_PER_PAGE as u32;
  constant VM_MAPSIZE (line 242) | pub const VM_MAPSIZE: usize = BLCKSZ as usize - MAXALIGN_SIZE_OF_PAGE_HE...
  constant VM_BITS_PER_HEAPBLOCK (line 243) | pub const VM_BITS_PER_HEAPBLOCK: usize = 2;
  constant VM_HEAPBLOCKS_PER_BYTE (line 244) | pub const VM_HEAPBLOCKS_PER_BYTE: usize = 8 / VM_BITS_PER_HEAPBLOCK;
  constant VM_HEAPBLOCKS_PER_PAGE (line 245) | pub const VM_HEAPBLOCKS_PER_PAGE: usize = VM_MAPSIZE * VM_HEAPBLOCKS_PER...
  constant REPLICATION_STATE_MAGIC (line 248) | pub const REPLICATION_STATE_MAGIC: u32 = 0x1257DADE;
  constant PGDATA_SPECIAL_FILES (line 254) | pub const PGDATA_SPECIAL_FILES: [&str; 3] =

FILE: libs/postgres_ffi/src/pg_constants_v14.rs
  constant MY_PGVERSION (line 3) | pub const MY_PGVERSION: PgMajorVersion = PgMajorVersion::PG14;
  constant XLOG_DBASE_CREATE (line 5) | pub const XLOG_DBASE_CREATE: u8 = 0x00;
  constant XLOG_DBASE_DROP (line 6) | pub const XLOG_DBASE_DROP: u8 = 0x10;
  constant BKPIMAGE_IS_COMPRESSED (line 8) | pub const BKPIMAGE_IS_COMPRESSED: u8 = 0x02;
  constant BKPIMAGE_APPLY (line 9) | pub const BKPIMAGE_APPLY: u8 = 0x04;
  constant SIZEOF_RELMAPFILE (line 10) | pub const SIZEOF_RELMAPFILE: usize = 512;
  constant PGDATA_SUBDIRS (line 14) | pub const PGDATA_SUBDIRS: [&str; 22] = [
  function bkpimg_is_compressed (line 39) | pub fn bkpimg_is_compressed(bimg_info: u8) -> bool {

FILE: libs/postgres_ffi/src/pg_constants_v15.rs
  constant MY_PGVERSION (line 3) | pub const MY_PGVERSION: PgMajorVersion = PgMajorVersion::PG15;
  constant XACT_XINFO_HAS_DROPPED_STATS (line 5) | pub const XACT_XINFO_HAS_DROPPED_STATS: u32 = 1u32 << 8;
  constant XLOG_DBASE_CREATE_FILE_COPY (line 7) | pub const XLOG_DBASE_CREATE_FILE_COPY: u8 = 0x00;
  constant XLOG_DBASE_CREATE_WAL_LOG (line 8) | pub const XLOG_DBASE_CREATE_WAL_LOG: u8 = 0x10;
  constant XLOG_DBASE_DROP (line 9) | pub const XLOG_DBASE_DROP: u8 = 0x20;
  constant BKPIMAGE_APPLY (line 11) | pub const BKPIMAGE_APPLY: u8 = 0x02;
  constant BKPIMAGE_COMPRESS_PGLZ (line 12) | pub const BKPIMAGE_COMPRESS_PGLZ: u8 = 0x04;
  constant BKPIMAGE_COMPRESS_LZ4 (line 13) | pub const BKPIMAGE_COMPRESS_LZ4: u8 = 0x08;
  constant BKPIMAGE_COMPRESS_ZSTD (line 14) | pub const BKPIMAGE_COMPRESS_ZSTD: u8 = 0x10;
  constant SIZEOF_RELMAPFILE (line 16) | pub const SIZEOF_RELMAPFILE: usize = 512;
  function bkpimg_is_compressed (line 20) | pub fn bkpimg_is_compressed(bimg_info: u8) -> bool {

FILE: libs/postgres_ffi/src/pg_constants_v16.rs
  constant MY_PGVERSION (line 3) | pub const MY_PGVERSION: PgMajorVersion = PgMajorVersion::PG16;
  constant XACT_XINFO_HAS_DROPPED_STATS (line 5) | pub const XACT_XINFO_HAS_DROPPED_STATS: u32 = 1u32 << 8;
  constant XLOG_DBASE_CREATE_FILE_COPY (line 7) | pub const XLOG_DBASE_CREATE_FILE_COPY: u8 = 0x00;
  constant XLOG_DBASE_CREATE_WAL_LOG (line 8) | pub const XLOG_DBASE_CREATE_WAL_LOG: u8 = 0x10;
  constant XLOG_DBASE_DROP (line 9) | pub const XLOG_DBASE_DROP: u8 = 0x20;
  constant BKPIMAGE_APPLY (line 11) | pub const BKPIMAGE_APPLY: u8 = 0x02;
  constant BKPIMAGE_COMPRESS_PGLZ (line 12) | pub const BKPIMAGE_COMPRESS_PGLZ: u8 = 0x04;
  constant BKPIMAGE_COMPRESS_LZ4 (line 13) | pub const BKPIMAGE_COMPRESS_LZ4: u8 = 0x08;
  constant BKPIMAGE_COMPRESS_ZSTD (line 14) | pub const BKPIMAGE_COMPRESS_ZSTD: u8 = 0x10;
  constant SIZEOF_RELMAPFILE (line 16) | pub const SIZEOF_RELMAPFILE: usize = 524;
  function bkpimg_is_compressed (line 20) | pub fn bkpimg_is_compressed(bimg_info: u8) -> bool {

FILE: libs/postgres_ffi/src/pg_constants_v17.rs
  constant MY_PGVERSION (line 3) | pub const MY_PGVERSION: PgMajorVersion = PgMajorVersion::PG17;
  constant XACT_XINFO_HAS_DROPPED_STATS (line 5) | pub const XACT_XINFO_HAS_DROPPED_STATS: u32 = 1u32 << 8;
  constant XLOG_DBASE_CREATE_FILE_COPY (line 7) | pub const XLOG_DBASE_CREATE_FILE_COPY: u8 = 0x00;
  constant XLOG_DBASE_CREATE_WAL_LOG (line 8) | pub const XLOG_DBASE_CREATE_WAL_LOG: u8 = 0x10;
  constant XLOG_DBASE_DROP (line 9) | pub const XLOG_DBASE_DROP: u8 = 0x20;
  constant BKPIMAGE_APPLY (line 11) | pub const BKPIMAGE_APPLY: u8 = 0x02;
  constant BKPIMAGE_COMPRESS_PGLZ (line 12) | pub const BKPIMAGE_COMPRESS_PGLZ: u8 = 0x04;
  constant BKPIMAGE_COMPRESS_LZ4 (line 13) | pub const BKPIMAGE_COMPRESS_LZ4: u8 = 0x08;
  constant BKPIMAGE_COMPRESS_ZSTD (line 14) | pub const BKPIMAGE_COMPRESS_ZSTD: u8 = 0x10;
  constant SIZEOF_RELMAPFILE (line 16) | pub const SIZEOF_RELMAPFILE: usize = 524;
  constant PGDATA_SUBDIRS (line 20) | pub const PGDATA_SUBDIRS: [&str; 23] = [
  function bkpimg_is_compressed (line 46) | pub fn bkpimg_is_compressed(bimg_info: u8) -> bool {
  constant XLOG_HEAP2_PRUNE_ON_ACCESS (line 53) | pub const XLOG_HEAP2_PRUNE_ON_ACCESS: u8 = 0x10;
  constant XLOG_HEAP2_PRUNE_VACUUM_SCAN (line 54) | pub const XLOG_HEAP2_PRUNE_VACUUM_SCAN: u8 = 0x20;
  constant XLOG_HEAP2_PRUNE_VACUUM_CLEANUP (line 55) | pub const XLOG_HEAP2_PRUNE_VACUUM_CLEANUP: u8 = 0x30;
  constant XLOG_OVERWRITE_CONTRECORD (line 58) | pub const XLOG_OVERWRITE_CONTRECORD: u8 = 0xD0;
  constant XLOG_CHECKPOINT_REDO (line 59) | pub const XLOG_CHECKPOINT_REDO: u8 = 0xE0;

FILE: libs/postgres_ffi/src/relfile_utils.rs
  function parse_relfilename (line 22) | pub fn parse_relfilename(fname: &str) -> Result<(u32, u8, u32), FilePath...
  function test_parse_valid_relfilenames (line 61) | fn test_parse_valid_relfilenames() {
  function test_parse_invalid_relfilenames (line 77) | fn test_parse_invalid_relfilenames() {
  function test_parse_weird_relfilenames (line 107) | fn test_parse_weird_relfilenames() {

FILE: libs/postgres_ffi/src/wal_generator.rs
  type Record (line 20) | pub struct Record {
    method encode (line 29) | pub fn encode(&self, prev_lsn: Lsn) -> Bytes {
  type RecordGenerator (line 69) | pub trait RecordGenerator: Iterator<Item = Record> {}
  type WalGenerator (line 89) | pub struct WalGenerator<R: RecordGenerator> {
  constant SYS_ID (line 105) | const SYS_ID: u64 = 0;
  constant TIMELINE_ID (line 106) | const TIMELINE_ID: u32 = 1;
  function new (line 109) | pub fn new(record_generator: R, start_lsn: Lsn) -> WalGenerator<R> {
  function append_record (line 119) | fn append_record(&mut self, record: Record) -> (Lsn, Bytes) {
  function insert_pages (line 131) | fn insert_pages(record: Bytes, mut lsn: Lsn) -> Bytes {
  function pad_record (line 184) | fn pad_record(record: Bytes, mut lsn: Lsn) -> Bytes {
  type Item (line 196) | type Item = (Lsn, Bytes);
  method next (line 198) | fn next(&mut self) -> Option<Self::Item> {
  type LogicalMessageGenerator (line 205) | pub struct LogicalMessageGenerator {
    constant DB_ID (line 211) | const DB_ID: u32 = 0;
    constant RM_ID (line 212) | const RM_ID: RmgrId = RM_LOGICALMSG_ID;
    constant INFO (line 213) | const INFO: u8 = XLOG_LOGICAL_MESSAGE;
    method new (line 216) | pub fn new(prefix: &CStr, message: &[u8]) -> Self {
    method encode (line 224) | fn encode(prefix: &CStr, message: &[u8]) -> Bytes {
    method make_value_size (line 237) | pub fn make_value_size(record_size: usize, prefix: &CStr) -> usize {
  type Item (line 253) | type Item = Record;
  method next (line 255) | fn next(&mut self) -> Option<Self::Item> {
  function append_logical_message (line 267) | pub fn append_logical_message(&mut self, prefix: &CStr, message: &[u8]) ...

FILE: libs/postgres_ffi/src/waldecoder_handler.rs
  type WalStreamDecoderHandler (line 21) | pub trait WalStreamDecoderHandler {
    method validate_page_header (line 22) | fn validate_page_header(&self, hdr: &XLogPageHeaderData) -> Result<(),...
    method poll_decode_internal (line 23) | fn poll_decode_internal(&mut self) -> Result<Option<(Lsn, Bytes)>, Wal...
    method complete_record (line 24) | fn complete_record(&mut self, recordbuf: Bytes) -> Result<(Lsn, Bytes)...
    method validate_page_header (line 39) | fn validate_page_header(&self, hdr: &XLogPageHeaderData) -> Result<(),...
    method poll_decode_internal (line 99) | fn poll_decode_internal(&mut self) -> Result<Option<(Lsn, Bytes)>, Wal...
    method complete_record (line 215) | fn complete_record(&mut self, recordbuf: Bytes) -> Result<(Lsn, Bytes)...

FILE: libs/postgres_ffi/src/walrecord.rs
  type XlMultiXactCreate (line 19) | pub struct XlMultiXactCreate {
    method decode (line 30) | pub fn decode(buf: &mut Bytes) -> XlMultiXactCreate {
  type XlMultiXactTruncate (line 49) | pub struct XlMultiXactTruncate {
    method decode (line 62) | pub fn decode(buf: &mut Bytes) -> XlMultiXactTruncate {
  type XlRelmapUpdate (line 75) | pub struct XlRelmapUpdate {
    method decode (line 82) | pub fn decode(buf: &mut Bytes) -> XlRelmapUpdate {
  type XlReploriginDrop (line 93) | pub struct XlReploriginDrop {
    method decode (line 98) | pub fn decode(buf: &mut Bytes) -> XlReploriginDrop {
  type XlReploriginSet (line 107) | pub struct XlReploriginSet {
    method decode (line 113) | pub fn decode(buf: &mut Bytes) -> XlReploriginSet {
  type RelFileNode (line 123) | pub struct RelFileNode {
  type MultiXactMember (line 131) | pub struct MultiXactMember {
    method decode (line 137) | pub fn decode(buf: &mut Bytes) -> MultiXactMember {
  type DecodedBkpBlock (line 147) | pub struct DecodedBkpBlock {
    method new (line 182) | pub fn new() -> DecodedBkpBlock {
  type DecodedWALRecord (line 188) | pub struct DecodedWALRecord {
    method is_dbase_create_copy (line 203) | pub fn is_dbase_create_copy(&self, pg_version: PgMajorVersion) -> bool {
  function decode_wal_record (line 246) | pub fn decode_wal_record(
  type XlHeapInsert (line 513) | pub struct XlHeapInsert {
    method decode (line 519) | pub fn decode(buf: &mut Bytes) -> XlHeapInsert {
  type XlHeapMultiInsert (line 529) | pub struct XlHeapMultiInsert {
    method decode (line 536) | pub fn decode(buf: &mut Bytes) -> XlHeapMultiInsert {
  type XlHeapDelete (line 547) | pub struct XlHeapDelete {
    method decode (line 557) | pub fn decode(buf: &mut Bytes) -> XlHeapDelete {
    method decode (line 691) | pub fn decode(buf: &mut Bytes) -> XlHeapDelete {
  type XlHeapUpdate (line 571) | pub struct XlHeapUpdate {
    method decode (line 582) | pub fn decode(buf: &mut Bytes) -> XlHeapUpdate {
    method decode (line 713) | pub fn decode(buf: &mut Bytes) -> XlHeapUpdate {
  type XlHeapLock (line 597) | pub struct XlHeapLock {
    method decode (line 607) | pub fn decode(buf: &mut Bytes) -> XlHeapLock {
    method decode (line 735) | pub fn decode(buf: &mut Bytes) -> XlHeapLock {
  type XlHeapLockUpdated (line 621) | pub struct XlHeapLockUpdated {
    method decode (line 629) | pub fn decode(buf: &mut Bytes) -> XlHeapLockUpdated {
  type XlParameterChange (line 641) | pub struct XlParameterChange {
    method decode (line 654) | pub fn decode(buf: &mut Bytes) -> XlParameterChange {
  type XlHeapDelete (line 683) | pub struct XlHeapDelete {
    method decode (line 557) | pub fn decode(buf: &mut Bytes) -> XlHeapDelete {
    method decode (line 691) | pub fn decode(buf: &mut Bytes) -> XlHeapDelete {
  type XlHeapUpdate (line 703) | pub struct XlHeapUpdate {
    method decode (line 582) | pub fn decode(buf: &mut Bytes) -> XlHeapUpdate {
    method decode (line 713) | pub fn decode(buf: &mut Bytes) -> XlHeapUpdate {
  type XlHeapLock (line 727) | pub struct XlHeapLock {
    method decode (line 607) | pub fn decode(buf: &mut Bytes) -> XlHeapLock {
    method decode (line 735) | pub fn decode(buf: &mut Bytes) -> XlHeapLock {
  type XlNeonHeapInsert (line 753) | pub struct XlNeonHeapInsert {
    method decode (line 759) | pub fn decode(buf: &mut Bytes) -> XlNeonHeapInsert {
  type XlNeonHeapMultiInsert (line 769) | pub struct XlNeonHeapMultiInsert {
    method decode (line 777) | pub fn decode(buf: &mut Bytes) -> XlNeonHeapMultiInsert {
  type XlNeonHeapDelete (line 789) | pub struct XlNeonHeapDelete {
    method decode (line 798) | pub fn decode(buf: &mut Bytes) -> XlNeonHeapDelete {
  type XlNeonHeapUpdate (line 811) | pub struct XlNeonHeapUpdate {
    method decode (line 822) | pub fn decode(buf: &mut Bytes) -> XlNeonHeapUpdate {
  type XlNeonHeapLock (line 837) | pub struct XlNeonHeapLock {
    method decode (line 846) | pub fn decode(buf: &mut Bytes) -> XlNeonHeapLock {
  type XlEndOfRecovery (line 872) | pub struct XlEndOfRecovery {
    method decode (line 880) | pub fn decode(buf: &mut Bytes) -> XlEndOfRecovery {
  type XlSmgrCreate (line 893) | pub struct XlSmgrCreate {
    method decode (line 901) | pub fn decode(buf: &mut Bytes) -> XlSmgrCreate {
  type XlSmgrTruncate (line 915) | pub struct XlSmgrTruncate {
    method decode (line 922) | pub fn decode(buf: &mut Bytes) -> XlSmgrTruncate {
  type XlCreateDatabase (line 937) | pub struct XlCreateDatabase {
    method decode (line 945) | pub fn decode(buf: &mut Bytes) -> XlCreateDatabase {
  type XlDropDatabase (line 957) | pub struct XlDropDatabase {
    method decode (line 964) | pub fn decode(buf: &mut Bytes) -> XlDropDatabase {
  type XlXactParsedRecord (line 988) | pub struct XlXactParsedRecord {
    method decode (line 1008) | pub fn decode(buf: &mut Bytes, mut xid: TransactionId, xl_info: u8) ->...
  type XlClogTruncate (line 1101) | pub struct XlClogTruncate {
    method decode (line 1108) | pub fn decode(buf: &mut Bytes, pg_version: PgMajorVersion) -> XlClogTr...
  type XlLogicalMessage (line 1123) | pub struct XlLogicalMessage {
    method decode (line 1131) | pub fn decode(buf: &mut Bytes) -> XlLogicalMessage {
  type XlRunningXacts (line 1143) | pub struct XlRunningXacts {
    method decode (line 1154) | pub fn decode(buf: &mut Bytes) -> XlRunningXacts {
  function describe_postgres_wal_record (line 1177) | pub fn describe_postgres_wal_record(record: &Bytes) -> Result<String, De...

FILE: libs/postgres_ffi/src/xlog_utils.rs
  constant XLOG_FNAME_LEN (line 39) | pub const XLOG_FNAME_LEN: usize = 24;
  constant XLP_BKP_REMOVABLE (line 40) | pub const XLP_BKP_REMOVABLE: u16 = 0x0004;
  constant XLP_FIRST_IS_CONTRECORD (line 41) | pub const XLP_FIRST_IS_CONTRECORD: u16 = 0x0001;
  constant XLP_REM_LEN_OFFS (line 42) | pub const XLP_REM_LEN_OFFS: usize = 2 + 2 + 4 + 8;
  constant XLOG_RECORD_CRC_OFFS (line 43) | pub const XLOG_RECORD_CRC_OFFS: usize = 4 + 4 + 8 + 1 + 1 + 2;
  constant XLOG_SIZE_OF_XLOG_SHORT_PHD (line 45) | pub const XLOG_SIZE_OF_XLOG_SHORT_PHD: usize = size_of::<XLogPageHeaderD...
  constant XLOG_SIZE_OF_XLOG_LONG_PHD (line 46) | pub const XLOG_SIZE_OF_XLOG_LONG_PHD: usize = size_of::<XLogLongPageHead...
  constant XLOG_SIZE_OF_XLOG_RECORD (line 47) | pub const XLOG_SIZE_OF_XLOG_RECORD: usize = size_of::<XLogRecord>();
  consta
Copy disabled (too large) Download .json
Condensed preview — 1874 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (16,323K chars).
[
  {
    "path": ".cargo/config.toml",
    "chars": 795,
    "preview": "[build]\n# This is only present for local builds, as it will be overridden\n# by the RUSTDOCFLAGS env var in CI.\nrustdocfl"
  },
  {
    "path": ".config/hakari.toml",
    "chars": 2035,
    "preview": "# This file contains settings for `cargo hakari`.\n# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a fu"
  },
  {
    "path": ".config/nextest.toml",
    "chars": 73,
    "preview": "[profile.default]\nslow-timeout = { period = \"60s\", terminate-after = 3 }\n"
  },
  {
    "path": ".dockerignore",
    "chars": 411,
    "preview": "*\n\n# Files\n!Cargo.lock\n!Cargo.toml\n!Makefile\n!postgres.mk\n!rust-toolchain.toml\n!scripts/ninstall.sh\n!docker-compose/run-"
  },
  {
    "path": ".git-blame-ignore-revs",
    "chars": 41,
    "preview": "4c2bb43775947775401cbb9d774823c5723a91f8\n"
  },
  {
    "path": ".gitattributes",
    "chars": 61,
    "preview": "# allows for nicer hunk headers with git show\n*.rs diff=rust\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug-template.md",
    "chars": 208,
    "preview": "---\nname: Bug Template\nabout: Used for describing bugs\ntitle: ''\nlabels: t/bug\ntype: Bug\nassignees: ''\n\n---\n\n## Steps to"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 252,
    "preview": "\nblank_issues_enabled: true\ncontact_links:\n  - name: Feature request\n    url: https://console.neon.tech/app/projects?mod"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/epic-template.md",
    "chars": 331,
    "preview": "---\nname: Epic Template\nabout: A set of related tasks contributing towards specific outcome, comprising of\n  more than 1"
  },
  {
    "path": ".github/actionlint.yml",
    "chars": 1268,
    "preview": "self-hosted-runner:\n  labels:\n    - arm64\n    - large\n    - large-arm64\n    - small\n    - small-metal\n    - small-arm64\n"
  },
  {
    "path": ".github/actions/allure-report-generate/action.yml",
    "chars": 9966,
    "preview": "name: 'Create Allure report'\ndescription: 'Generate Allure report from uploaded by actions/allure-report-store tests res"
  },
  {
    "path": ".github/actions/allure-report-store/action.yml",
    "chars": 3042,
    "preview": "name: 'Store Allure results'\ndescription: 'Upload test results to be used by actions/allure-report-generate'\n\ninputs:\n  "
  },
  {
    "path": ".github/actions/download/action.yml",
    "chars": 2356,
    "preview": "name: \"Download an artifact\"\ndescription: \"Custom download action\"\ninputs:\n  name:\n    description: \"Artifact name\"\n    "
  },
  {
    "path": ".github/actions/neon-branch-create/action.yml",
    "chars": 4685,
    "preview": "name: 'Create Branch'\ndescription: 'Create Branch using API'\n\ninputs:\n  api_key:\n    description: 'Neon API key'\n    req"
  },
  {
    "path": ".github/actions/neon-branch-delete/action.yml",
    "chars": 1761,
    "preview": "name: 'Delete Branch'\ndescription: 'Delete Branch using API'\n\ninputs:\n  api_key:\n    description: 'Neon API key'\n    req"
  },
  {
    "path": ".github/actions/neon-project-create/action.yml",
    "chars": 6753,
    "preview": "name: 'Create Neon Project'\ndescription: 'Create Neon Project using API'\n\ninputs:\n  api_key:\n    description: 'Neon API "
  },
  {
    "path": ".github/actions/neon-project-delete/action.yml",
    "chars": 1033,
    "preview": "name: 'Delete Neon Project'\ndescription: 'Delete Neon Project using API'\n\ninputs:\n  api_key:\n    description: 'Neon API "
  },
  {
    "path": ".github/actions/prepare-for-subzero/action.yml",
    "chars": 1239,
    "preview": "name: 'Prepare current job for subzero'\ndescription: >\n  Set git token to access `neondatabase/subzero` from cargo build"
  },
  {
    "path": ".github/actions/run-python-test-set/action.yml",
    "chars": 10225,
    "preview": "name: 'Run python test'\ndescription: 'Runs a Neon python test set, performing all the required preparations before'\n\ninp"
  },
  {
    "path": ".github/actions/save-coverage-data/action.yml",
    "chars": 840,
    "preview": "name: 'Merge and upload coverage data'\ndescription: 'Compresses and uploads the coverage data as an artifact'\n\nruns:\n  u"
  },
  {
    "path": ".github/actions/upload/action.yml",
    "chars": 2836,
    "preview": "name: \"Upload an artifact\"\ndescription: \"Custom upload action\"\ninputs:\n  name:\n    description: \"Artifact name\"\n    requ"
  },
  {
    "path": ".github/file-filters.yaml",
    "chars": 438,
    "preview": "rust_code: ['**/*.rs', '**/Cargo.toml', '**/Cargo.lock']\nrust_dependencies: ['**/Cargo.lock']\n\nv14: ['vendor/postgres-v1"
  },
  {
    "path": ".github/pull_request_template.md",
    "chars": 34,
    "preview": "## Problem\n\n## Summary of changes\n"
  },
  {
    "path": ".github/scripts/generate_image_maps.py",
    "chars": 2054,
    "preview": "import itertools\nimport json\nimport os\nimport sys\n\nsource_tag = os.getenv(\"SOURCE_TAG\")\ntarget_tag = os.getenv(\"TARGET_T"
  },
  {
    "path": ".github/scripts/lint-release-pr.sh",
    "chars": 4197,
    "preview": "#!/usr/bin/env bash\n\nset -euo pipefail\n\nDOCS_URL=\"https://docs.neon.build/overview/repositories/neon.html\"\n\nmessage() {\n"
  },
  {
    "path": ".github/scripts/previous-releases.jq",
    "chars": 1368,
    "preview": "# Expects response from https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases as input,\n"
  },
  {
    "path": ".github/scripts/push_with_image_map.py",
    "chars": 1548,
    "preview": "import json\nimport os\nimport subprocess\n\nRED = \"\\033[91m\"\nRESET = \"\\033[0m\"\n\nimage_map = os.getenv(\"IMAGE_MAP\")\nif not i"
  },
  {
    "path": ".github/workflows/_benchmarking_preparation.yml",
    "chars": 7024,
    "preview": "name: Prepare benchmarking databases by restoring dumps\n\non:\n  workflow_call:\n    # no inputs needed\n\ndefaults:\n  run:\n "
  },
  {
    "path": ".github/workflows/_build-and-test-locally.yml",
    "chars": 17080,
    "preview": "name: Build and Test Locally\n\non:\n  workflow_call:\n    inputs:\n      arch:\n        description: 'x64 or arm64'\n        r"
  },
  {
    "path": ".github/workflows/_check-codestyle-python.yml",
    "chars": 1565,
    "preview": "name: Check Codestyle Python\n\non:\n  workflow_call:\n    inputs:\n      build-tools-image:\n        description: 'build-tool"
  },
  {
    "path": ".github/workflows/_check-codestyle-rust.yml",
    "chars": 4099,
    "preview": "name: Check Codestyle Rust\n\non:\n  workflow_call:\n    inputs:\n      build-tools-image:\n        description: \"build-tools "
  },
  {
    "path": ".github/workflows/_meta.yml",
    "chars": 7710,
    "preview": "name: Generate run metadata\non:\n  workflow_call:\n    inputs:\n      github-event-name:\n        type: string\n        requi"
  },
  {
    "path": ".github/workflows/_push-to-container-registry.yml",
    "chars": 5072,
    "preview": "name: Push images to Container Registry\non:\n  workflow_call:\n    inputs:\n      # Example: {\"docker.io/neondatabase/neon:"
  },
  {
    "path": ".github/workflows/actionlint.yml",
    "chars": 1835,
    "preview": "name: Lint GitHub Workflows\n\non:\n  push:\n    branches:\n      - main\n      - release\n    paths:\n      - '.github/workflow"
  },
  {
    "path": ".github/workflows/approved-for-ci-run.yml",
    "chars": 7255,
    "preview": "name: Handle `approved-for-ci-run` label\n# This workflow helps to run CI pipeline for PRs made by external contributors "
  },
  {
    "path": ".github/workflows/benchbase_tpcc.yml",
    "chars": 15750,
    "preview": "name: TPC-C like benchmark using benchbase\n\non:\n  schedule:\n    # * is a special character in YAML so you have to quote "
  },
  {
    "path": ".github/workflows/benchmarking.yml",
    "chars": 53659,
    "preview": "name: Benchmarking\n\non:\n  # uncomment to run on push for debugging your PR\n  # push:\n  #   branches: [ your branch ]\n  s"
  },
  {
    "path": ".github/workflows/build-build-tools-image.yml",
    "chars": 7930,
    "preview": "name: Build build-tools image\n\non:\n  workflow_call:\n    inputs:\n      archs:\n        description: \"Json array of archite"
  },
  {
    "path": ".github/workflows/build-macos.yml",
    "chars": 4896,
    "preview": "name: Check neon with MacOS builds\n\non:\n  workflow_call:\n    inputs:\n      pg_versions:\n        description: \"Array of t"
  },
  {
    "path": ".github/workflows/build_and_run_selected_test.yml",
    "chars": 3744,
    "preview": "name: Build and Run Selected Test\n\non:\n  workflow_dispatch:\n    inputs:\n      test-selection:\n        description: 'Spec"
  },
  {
    "path": ".github/workflows/build_and_test.yml",
    "chars": 72600,
    "preview": "name: Build and Test\n\non:\n  push:\n    branches:\n      - main\n      - release\n      - release-proxy\n      - release-compu"
  },
  {
    "path": ".github/workflows/build_and_test_fully.yml",
    "chars": 5585,
    "preview": "name: Build and Test Fully\n\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this string\n    "
  },
  {
    "path": ".github/workflows/build_and_test_with_sanitizers.yml",
    "chars": 5121,
    "preview": "name: Build and Test with Sanitizers\n\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this s"
  },
  {
    "path": ".github/workflows/cargo-deny.yml",
    "chars": 2199,
    "preview": "name: cargo deny checks\n\non:\n  workflow_call:\n    inputs:\n      build-tools-image:\n        required: false\n        type:"
  },
  {
    "path": ".github/workflows/check-permissions.yml",
    "chars": 1321,
    "preview": "name: Check Permissions\n\non:\n  workflow_call:\n    inputs:\n      github-event-name:\n        required: true\n        type: "
  },
  {
    "path": ".github/workflows/cleanup-caches-by-a-branch.yml",
    "chars": 1181,
    "preview": "# A workflow from\n# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-"
  },
  {
    "path": ".github/workflows/cloud-extensions.yml",
    "chars": 3633,
    "preview": "name: Cloud Extensions Test\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this string\n    "
  },
  {
    "path": ".github/workflows/cloud-regress.yml",
    "chars": 4914,
    "preview": "name: Cloud Regression Test\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this string\n    "
  },
  {
    "path": ".github/workflows/fast-forward.yml",
    "chars": 1646,
    "preview": "name: Fast forward merge\non:\n  pull_request:\n    types: [labeled]\n    branches:\n      - release\n      - release-proxy\n  "
  },
  {
    "path": ".github/workflows/force-test-extensions-upgrade.yml",
    "chars": 2933,
    "preview": "name: Force Test Upgrading of Extension\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this"
  },
  {
    "path": ".github/workflows/ingest_benchmark.yml",
    "chars": 9251,
    "preview": "name: benchmarking ingest\n\non:\n  # uncomment to run on push for debugging your PR\n  # push:\n  #   branches: [ your branc"
  },
  {
    "path": ".github/workflows/label-for-external-users.yml",
    "chars": 2854,
    "preview": "name: Add `external` label to issues and PRs created by external users\n\non:\n  issues:\n    types:\n      - opened\n  pull_r"
  },
  {
    "path": ".github/workflows/large_oltp_benchmark.yml",
    "chars": 8717,
    "preview": "name: large oltp benchmark\n\non:\n  # uncomment to run on push for debugging your PR\n  #push:\n  #  branches: [ bodobolero/"
  },
  {
    "path": ".github/workflows/large_oltp_growth.yml",
    "chars": 6607,
    "preview": "name: large oltp growth\n# workflow to grow the reuse branch of large oltp benchmark continuously (about 16 GB per run)\n\n"
  },
  {
    "path": ".github/workflows/lint-release-pr.yml",
    "chars": 817,
    "preview": "name: Lint Release PR\n\non:\n  pull_request:\n    branches:\n      - release\n      - release-proxy\n      - release-compute\n\n"
  },
  {
    "path": ".github/workflows/neon_extra_builds.yml",
    "chars": 6099,
    "preview": "name: Check neon with extra platform builds\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\ndefaults:\n  run:\n  "
  },
  {
    "path": ".github/workflows/periodic_pagebench.yml",
    "chars": 12331,
    "preview": "name: Periodic pagebench performance test on unit-perf-aws-arm runners\n\non:\n  schedule:\n    # * is a special character i"
  },
  {
    "path": ".github/workflows/pg-clients.yml",
    "chars": 8611,
    "preview": "name: Test Postgres client libraries\n\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this s"
  },
  {
    "path": ".github/workflows/pin-build-tools-image.yml",
    "chars": 3783,
    "preview": "name: 'Pin build-tools image'\n\non:\n  workflow_dispatch:\n    inputs:\n      from-tag:\n        description: 'Source tag'\n  "
  },
  {
    "path": ".github/workflows/pre-merge-checks.yml",
    "chars": 6601,
    "preview": "name: Pre-merge checks\n\non:\n  pull_request:\n    paths:\n      - .github/workflows/_check-codestyle-python.yml\n      - .gi"
  },
  {
    "path": ".github/workflows/proxy-benchmark.yml",
    "chars": 3488,
    "preview": "name: Periodic proxy performance test on unit-perf-aws-arm runners\n\non:\n  push: # TODO: remove after testing\n    branche"
  },
  {
    "path": ".github/workflows/random-ops-test.yml",
    "chars": 2820,
    "preview": "name: Random Operations Test\n\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this string\n  "
  },
  {
    "path": ".github/workflows/regenerate-pg-setting.yml",
    "chars": 1284,
    "preview": "name: Regenerate Postgres Settings\n\non:\n  pull_request:\n    types:\n      - opened\n      - synchronize\n      - reopened\n "
  },
  {
    "path": ".github/workflows/release-compute.yml",
    "chars": 201,
    "preview": "name: Create compute release PR\n\non:\n  schedule:\n    - cron: '0 7 * * FRI'\n\njobs:\n  create-release-pr:\n    uses: ./.gith"
  },
  {
    "path": ".github/workflows/release-notify.yml",
    "chars": 1098,
    "preview": "name: Notify Slack channel about upcoming release\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.event.number "
  },
  {
    "path": ".github/workflows/release-proxy.yml",
    "chars": 197,
    "preview": "name: Create proxy release PR\n\non:\n  schedule:\n    - cron: '0 6 * * TUE'\n\njobs:\n  create-release-pr:\n    uses: ./.github"
  },
  {
    "path": ".github/workflows/release-storage.yml",
    "chars": 201,
    "preview": "name: Create storage release PR\n\non:\n  schedule:\n    - cron: '0 6 * * FRI'\n\njobs:\n  create-release-pr:\n    uses: ./.gith"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 1862,
    "preview": "name: Create release PR\n\non:\n  workflow_dispatch:\n    inputs:\n      component:\n        description: \"Component to releas"
  },
  {
    "path": ".github/workflows/report-workflow-stats-batch.yml",
    "chars": 2349,
    "preview": "name: Report Workflow Stats Batch\n\non:\n  schedule:\n    - cron: '*/15 * * * *'\n    - cron: '25 0 * * *'\n    - cron: '25 1"
  },
  {
    "path": ".github/workflows/trigger-e2e-tests.yml",
    "chars": 6696,
    "preview": "name: Trigger E2E Tests\n\non:\n  pull_request:\n    types:\n      - ready_for_review\n  workflow_call:\n    inputs:\n      gith"
  },
  {
    "path": ".gitignore",
    "chars": 438,
    "preview": "/artifact_cache\n/build\n/pg_install\n/target\n/tmp_check\n/tmp_check_cli\n__pycache__/\ntest_output/\nneon_previous/\n.vscode\n.i"
  },
  {
    "path": ".gitmodules",
    "chars": 456,
    "preview": "[submodule \"vendor/postgres-v14\"]\n\tpath = vendor/postgres-v14\n\turl = ../postgres.git\n\tbranch = REL_14_STABLE_neon\n[submo"
  },
  {
    "path": ".neon_clippy_args",
    "chars": 396,
    "preview": "# * `-A unknown_lints` – do not warn about unknown lint suppressions\n#                        that people with newer too"
  },
  {
    "path": "CODEOWNERS",
    "chars": 870,
    "preview": "# Autoscaling\n/libs/vm_monitor/ @neondatabase/autoscaling\n\n# DevProd & PerfCorr\n/.github/ @neondatabase/developer-produc"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 3730,
    "preview": "# How to contribute\n\nHowdy! Usual good software engineering practices apply. Write\ntests. Write comments. Follow standar"
  },
  {
    "path": "Cargo.toml",
    "chars": 13569,
    "preview": "[workspace]\nresolver = \"2\"\nmembers = [\n    \"compute_tools\",\n    \"control_plane\",\n    \"control_plane/storcon_cli\",\n    \"p"
  },
  {
    "path": "Dockerfile",
    "chars": 9191,
    "preview": "### Creates a storage Docker image with postgres, pageserver, safekeeper and proxy binaries.\n### The image itself is mai"
  },
  {
    "path": "LICENSE",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "Makefile",
    "chars": 10258,
    "preview": "ROOT_PROJECT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))\n\n# Where to install Postgres, default is ./pg_install"
  },
  {
    "path": "NOTICE",
    "chars": 164,
    "preview": "Neon\nCopyright 2022 - 2024 Neon Inc.\n\nThe PostgreSQL submodules in vendor/ are licensed under the PostgreSQL license.\nSe"
  },
  {
    "path": "README.md",
    "chars": 13835,
    "preview": "[![Neon](https://github.com/user-attachments/assets/fd91da5f-44a9-41c7-9075-36a5b5608083)](https://neon.com)\n\n\n\n# Neon\n\n"
  },
  {
    "path": "build-tools/Dockerfile",
    "chars": 14990,
    "preview": "ARG DEBIAN_VERSION=bookworm\nARG DEBIAN_FLAVOR=${DEBIAN_VERSION}-slim\n\n# Here are the INDEX DIGESTS for the images we use"
  },
  {
    "path": "build-tools/package.json",
    "chars": 144,
    "preview": "{\n  \"name\": \"build-tools\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"@redocly/cli\": \"1.34.5\",\n    \"@sourcemeta/json"
  },
  {
    "path": "build-tools/patches/pgcopydbv017.patch",
    "chars": 1598,
    "preview": "diff --git a/src/bin/pgcopydb/copydb.c b/src/bin/pgcopydb/copydb.c\nindex d730b03..69a9be9 100644\n--- a/src/bin/pgcopydb/"
  },
  {
    "path": "clippy.toml",
    "chars": 625,
    "preview": "disallowed-methods = [\n    \"tokio::task::block_in_place\",\n\n    # Allow this for now, to deny it later once we stop using"
  },
  {
    "path": "compute/.gitignore",
    "chars": 201,
    "preview": "# sql_exporter config files generated from Jsonnet\netc/neon_collector.yml\netc/neon_collector_autoscaling.yml\netc/sql_exp"
  },
  {
    "path": "compute/Makefile",
    "chars": 1997,
    "preview": "jsonnet_files = $(wildcard \\\n\tetc/*.jsonnet \\\n\tetc/sql_exporter/*.libsonnet)\n\n.PHONY: all\nall: neon_collector.yml neon_c"
  },
  {
    "path": "compute/README.md",
    "chars": 683,
    "preview": "This directory contains files that are needed to build the compute\nimages, or included in the compute images.\n\ncompute-n"
  },
  {
    "path": "compute/compute-node.Dockerfile",
    "chars": 90465,
    "preview": "#\n# This Dockerfile builds the compute image. It is built multiple times to produce\n# different images for each PostgreS"
  },
  {
    "path": "compute/etc/README.md",
    "chars": 711,
    "preview": "# Compute Configuration\n\nThese files are the configuration files for various other pieces of software\nthat will be runni"
  },
  {
    "path": "compute/etc/ld.so.conf.d/00-neon.conf",
    "chars": 15,
    "preview": "/usr/local/lib\n"
  },
  {
    "path": "compute/etc/neon_collector.jsonnet",
    "chars": 3265,
    "preview": "{\n  collector_name: 'neon_collector',\n  metrics: [\n    import 'sql_exporter/checkpoints_req.libsonnet',\n    import 'sql_"
  },
  {
    "path": "compute/etc/neon_collector_autoscaling.jsonnet",
    "chars": 406,
    "preview": "{\n  collector_name: 'neon_collector_autoscaling',\n  metrics: [\n    import 'sql_exporter/lfc_approximate_working_set_size"
  },
  {
    "path": "compute/etc/pgbouncer.ini",
    "chars": 1125,
    "preview": "[databases]\n;; pgbouncer propagates application_name (if it's specified) to the server, but some\n;; clients don't set it"
  },
  {
    "path": "compute/etc/postgres_exporter.yml",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "compute/etc/sql_exporter/checkpoints_req.17.sql",
    "chars": 78,
    "preview": "SELECT num_requested AS checkpoints_req FROM pg_catalog.pg_stat_checkpointer;\n"
  },
  {
    "path": "compute/etc/sql_exporter/checkpoints_req.libsonnet",
    "chars": 438,
    "preview": "local neon = import 'neon.libsonnet';\n\nlocal pg_stat_bgwriter = importstr 'sql_exporter/checkpoints_req.sql';\nlocal pg_s"
  },
  {
    "path": "compute/etc/sql_exporter/checkpoints_req.sql",
    "chars": 57,
    "preview": "SELECT checkpoints_req FROM pg_catalog.pg_stat_bgwriter;\n"
  },
  {
    "path": "compute/etc/sql_exporter/checkpoints_timed.17.sql",
    "chars": 65,
    "preview": "SELECT num_timed AS checkpoints_timed FROM pg_stat_checkpointer;\n"
  },
  {
    "path": "compute/etc/sql_exporter/checkpoints_timed.libsonnet",
    "chars": 446,
    "preview": "local neon = import 'neon.libsonnet';\n\nlocal pg_stat_bgwriter = importstr 'sql_exporter/checkpoints_timed.sql';\nlocal pg"
  },
  {
    "path": "compute/etc/sql_exporter/checkpoints_timed.sql",
    "chars": 59,
    "preview": "SELECT checkpoints_timed FROM pg_catalog.pg_stat_bgwriter;\n"
  },
  {
    "path": "compute/etc/sql_exporter/compute_backpressure_throttling_seconds_total.libsonnet",
    "chars": 270,
    "preview": "{\n  metric_name: 'compute_backpressure_throttling_seconds_total',\n  type: 'counter',\n  help: 'Time compute has spent thr"
  },
  {
    "path": "compute/etc/sql_exporter/compute_backpressure_throttling_seconds_total.sql",
    "chars": 88,
    "preview": "SELECT (neon.backpressure_throttling_time()::pg_catalog.float8 / 1000000) AS throttled;\n"
  },
  {
    "path": "compute/etc/sql_exporter/compute_current_lsn.libsonnet",
    "chars": 205,
    "preview": "{\n  metric_name: 'compute_current_lsn',\n  type: 'gauge',\n  help: 'Current LSN of the database',\n  key_labels: null,\n  va"
  },
  {
    "path": "compute/etc/sql_exporter/compute_current_lsn.sql",
    "chars": 200,
    "preview": "SELECT CASE\n  WHEN pg_catalog.pg_is_in_recovery() THEN (pg_catalog.pg_last_wal_replay_lsn() - '0/0')::pg_catalog.FLOAT8\n"
  },
  {
    "path": "compute/etc/sql_exporter/compute_getpage_max_inflight_stuck_time_ms.libsonnet",
    "chars": 339,
    "preview": "{\n  metric_name: 'compute_getpage_max_inflight_stuck_time_ms',\n  type: 'gauge',\n  help: 'Max wait time for stuck request"
  },
  {
    "path": "compute/etc/sql_exporter/compute_getpage_stuck_requests_total.libsonnet",
    "chars": 340,
    "preview": "{\n  metric_name: 'compute_getpage_stuck_requests_total',\n  type: 'counter',\n  help: 'Total number of Getpage requests le"
  },
  {
    "path": "compute/etc/sql_exporter/compute_logical_snapshot_files.libsonnet",
    "chars": 290,
    "preview": "{\n  metric_name: 'compute_logical_snapshot_files',\n  type: 'gauge',\n  help: 'Number of snapshot files in pg_logical/snap"
  },
  {
    "path": "compute/etc/sql_exporter/compute_logical_snapshot_files.sql",
    "chars": 486,
    "preview": "SELECT\n  (SELECT setting FROM pg_catalog.pg_settings WHERE name = 'neon.timeline_id') AS timeline_id,\n  -- Postgres crea"
  },
  {
    "path": "compute/etc/sql_exporter/compute_logical_snapshots_bytes.15.sql",
    "chars": 468,
    "preview": "SELECT\n  (SELECT pg_catalog.current_setting('neon.timeline_id')) AS timeline_id,\n  -- Postgres creates temporary snapsho"
  },
  {
    "path": "compute/etc/sql_exporter/compute_logical_snapshots_bytes.libsonnet",
    "chars": 542,
    "preview": "local neon = import 'neon.libsonnet';\n\nlocal pg_ls_logicalsnapdir = importstr 'sql_exporter/compute_logical_snapshots_by"
  },
  {
    "path": "compute/etc/sql_exporter/compute_logical_snapshots_bytes.sql",
    "chars": 614,
    "preview": "SELECT\n  (SELECT setting FROM pg_catalog.pg_settings WHERE name = 'neon.timeline_id') AS timeline_id,\n  -- Postgres crea"
  },
  {
    "path": "compute/etc/sql_exporter/compute_max_connections.libsonnet",
    "chars": 234,
    "preview": "{\n  metric_name: 'compute_max_connections',\n  type: 'gauge',\n  help: 'Max connections allowed for Postgres',\n  key_label"
  },
  {
    "path": "compute/etc/sql_exporter/compute_max_connections.sql",
    "chars": 73,
    "preview": "SELECT pg_catalog.current_setting('max_connections') AS max_connections;\n"
  },
  {
    "path": "compute/etc/sql_exporter/compute_pg_oldest_frozen_xid_age.libsonnet",
    "chars": 377,
    "preview": "{\n  metric_name: 'compute_pg_oldest_frozen_xid_age',\n  type: 'gauge',\n  help: 'Age of oldest XIDs that have not been fro"
  },
  {
    "path": "compute/etc/sql_exporter/compute_pg_oldest_frozen_xid_age.sql",
    "chars": 144,
    "preview": "SELECT datname database_name,\n   pg_catalog.age(datfrozenxid) frozen_xid_age\nFROM pg_catalog.pg_database\nORDER BY frozen"
  },
  {
    "path": "compute/etc/sql_exporter/compute_pg_oldest_mxid_age.libsonnet",
    "chars": 366,
    "preview": "{\n  metric_name: 'compute_pg_oldest_mxid_age',\n  type: 'gauge',\n  help: 'Age of oldest MXIDs that have not been replaced"
  },
  {
    "path": "compute/etc/sql_exporter/compute_pg_oldest_mxid_age.sql",
    "chars": 142,
    "preview": "SELECT datname database_name,\n  pg_catalog.mxid_age(datminmxid) min_mxid_age\nFROM pg_catalog.pg_database\nORDER BY min_mx"
  },
  {
    "path": "compute/etc/sql_exporter/compute_receive_lsn.libsonnet",
    "chars": 286,
    "preview": "{\n  metric_name: 'compute_receive_lsn',\n  type: 'gauge',\n  help: 'Returns the last write-ahead log location that has bee"
  },
  {
    "path": "compute/etc/sql_exporter/compute_receive_lsn.sql",
    "chars": 142,
    "preview": "SELECT CASE\n  WHEN pg_catalog.pg_is_in_recovery() THEN (pg_catalog.pg_last_wal_receive_lsn() - '0/0')::pg_catalog.FLOAT8"
  },
  {
    "path": "compute/etc/sql_exporter/compute_subscriptions_count.libsonnet",
    "chars": 297,
    "preview": "{\n  metric_name: 'compute_subscriptions_count',\n  type: 'gauge',\n  help: 'Number of logical replication subscriptions gr"
  },
  {
    "path": "compute/etc/sql_exporter/compute_subscriptions_count.sql",
    "chars": 143,
    "preview": "SELECT subenabled::pg_catalog.text AS enabled, pg_catalog.count(*) AS subscriptions_count FROM pg_catalog.pg_subscriptio"
  },
  {
    "path": "compute/etc/sql_exporter/connection_counts.libsonnet",
    "chars": 222,
    "preview": "{\n  metric_name: 'connection_counts',\n  type: 'gauge',\n  help: 'Connection counts',\n  key_labels: [\n    'datname',\n    '"
  },
  {
    "path": "compute/etc/sql_exporter/connection_counts.sql",
    "chars": 128,
    "preview": "SELECT datname, state, pg_catalog.count(*) AS count FROM pg_catalog.pg_stat_activity WHERE state <> '' GROUP BY datname,"
  },
  {
    "path": "compute/etc/sql_exporter/db_total_size.libsonnet",
    "chars": 189,
    "preview": "{\n  metric_name: 'db_total_size',\n  type: 'gauge',\n  help: 'Size of all databases',\n  key_labels: null,\n  values: [\n    "
  },
  {
    "path": "compute/etc/sql_exporter/db_total_size.sql",
    "chars": 232,
    "preview": "SELECT pg_catalog.sum(pg_catalog.pg_database_size(datname)) AS total\nFROM pg_catalog.pg_database\n-- Ignore invalid datab"
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_read_wait_seconds_bucket.libsonnet",
    "chars": 281,
    "preview": "{\n  metric_name: 'file_cache_read_wait_seconds_bucket',\n  type: 'counter',\n  help: 'Histogram buckets of LFC read operat"
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_read_wait_seconds_bucket.sql",
    "chars": 107,
    "preview": "SELECT bucket_le, value FROM neon.neon_perf_counters WHERE metric = 'file_cache_read_wait_seconds_bucket';\n"
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_read_wait_seconds_count.libsonnet",
    "chars": 214,
    "preview": "{\n  metric_name: 'file_cache_read_wait_seconds_count',\n  type: 'counter',\n  help: 'Number of read operations in LFC',\n  "
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_read_wait_seconds_sum.libsonnet",
    "chars": 211,
    "preview": "{\n  metric_name: 'file_cache_read_wait_seconds_sum',\n  type: 'counter',\n  help: 'Time spent in LFC read operations',\n  v"
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_write_wait_seconds_bucket.libsonnet",
    "chars": 284,
    "preview": "{\n  metric_name: 'file_cache_write_wait_seconds_bucket',\n  type: 'counter',\n  help: 'Histogram buckets of LFC write oper"
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_write_wait_seconds_bucket.sql",
    "chars": 108,
    "preview": "SELECT bucket_le, value FROM neon.neon_perf_counters WHERE metric = 'file_cache_write_wait_seconds_bucket';\n"
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_write_wait_seconds_count.libsonnet",
    "chars": 217,
    "preview": "{\n  metric_name: 'file_cache_write_wait_seconds_count',\n  type: 'counter',\n  help: 'Number of write operations in LFC',\n"
  },
  {
    "path": "compute/etc/sql_exporter/file_cache_write_wait_seconds_sum.libsonnet",
    "chars": 214,
    "preview": "{\n  metric_name: 'file_cache_write_wait_seconds_sum',\n  type: 'counter',\n  help: 'Time spent in LFC write operations',\n "
  },
  {
    "path": "compute/etc/sql_exporter/getpage_prefetch_discards_total.libsonnet",
    "chars": 224,
    "preview": "{\n  metric_name: 'getpage_prefetch_discards_total',\n  type: 'counter',\n  help: 'Number of prefetch responses issued but "
  },
  {
    "path": "compute/etc/sql_exporter/getpage_prefetch_misses_total.libsonnet",
    "chars": 374,
    "preview": "{\n  metric_name: 'getpage_prefetch_misses_total',\n  type: 'counter',\n  help: \"Total number of readahead misses; consisti"
  },
  {
    "path": "compute/etc/sql_exporter/getpage_prefetch_requests_total.libsonnet",
    "chars": 216,
    "preview": "{\n  metric_name: 'getpage_prefetch_requests_total',\n  type: 'counter',\n  help: 'Number of getpage issued for prefetching"
  },
  {
    "path": "compute/etc/sql_exporter/getpage_prefetches_buffered.libsonnet",
    "chars": 209,
    "preview": "{\n  metric_name: 'getpage_prefetches_buffered',\n  type: 'gauge',\n  help: 'Number of prefetched pages buffered in neon',\n"
  },
  {
    "path": "compute/etc/sql_exporter/getpage_sync_requests_total.libsonnet",
    "chars": 204,
    "preview": "{\n  metric_name: 'getpage_sync_requests_total',\n  type: 'counter',\n  help: 'Number of synchronous getpage issued',\n  val"
  },
  {
    "path": "compute/etc/sql_exporter/getpage_wait_seconds_bucket.libsonnet",
    "chars": 260,
    "preview": "{\n  metric_name: 'getpage_wait_seconds_bucket',\n  type: 'counter',\n  help: 'Histogram buckets of getpage request latency"
  },
  {
    "path": "compute/etc/sql_exporter/getpage_wait_seconds_bucket.sql",
    "chars": 99,
    "preview": "SELECT bucket_le, value FROM neon.neon_perf_counters WHERE metric = 'getpage_wait_seconds_bucket';\n"
  },
  {
    "path": "compute/etc/sql_exporter/getpage_wait_seconds_count.libsonnet",
    "chars": 192,
    "preview": "{\n  metric_name: 'getpage_wait_seconds_count',\n  type: 'counter',\n  help: 'Number of getpage requests',\n  values: [\n    "
  },
  {
    "path": "compute/etc/sql_exporter/getpage_wait_seconds_sum.libsonnet",
    "chars": 192,
    "preview": "{\n  metric_name: 'getpage_wait_seconds_sum',\n  type: 'counter',\n  help: 'Time spent in getpage requests',\n  values: [\n  "
  },
  {
    "path": "compute/etc/sql_exporter/lfc_approximate_working_set_size.libsonnet",
    "chars": 295,
    "preview": "// DEPRECATED\n\n{\n  metric_name: 'lfc_approximate_working_set_size',\n  type: 'gauge',\n  help: 'Approximate working set si"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_approximate_working_set_size.sql",
    "chars": 81,
    "preview": "SELECT neon.approximate_working_set_size(false) AS approximate_working_set_size;\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_approximate_working_set_size_windows.autoscaling.libsonnet",
    "chars": 309,
    "preview": "{\n  metric_name: 'lfc_approximate_working_set_size_windows',\n  type: 'gauge',\n  help: 'Approximate working set size in p"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_approximate_working_set_size_windows.autoscaling.sql",
    "chars": 349,
    "preview": "-- NOTE: This is the \"internal\" / \"machine-readable\" version. This outputs the\n-- working set size looking back 1..60 mi"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_approximate_working_set_size_windows.libsonnet",
    "chars": 289,
    "preview": "{\n  metric_name: 'lfc_approximate_working_set_size_windows',\n  type: 'gauge',\n  help: 'Approximate working set size in p"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_approximate_working_set_size_windows.sql",
    "chars": 330,
    "preview": "-- NOTE: This is the \"public\" / \"human-readable\" version. Here, we supply a\n-- small selection of durations in a pretty-"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_cache_size_limit.libsonnet",
    "chars": 226,
    "preview": "{\n  metric_name: 'lfc_cache_size_limit',\n  type: 'gauge',\n  help: 'LFC cache size limit in bytes',\n  key_labels: null,\n "
  },
  {
    "path": "compute/etc/sql_exporter/lfc_cache_size_limit.sql",
    "chars": 115,
    "preview": "SELECT pg_catalog.pg_size_bytes(pg_catalog.current_setting('neon.file_cache_size_limit')) AS lfc_cache_size_limit;\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_chunk_size.libsonnet",
    "chars": 223,
    "preview": "{\n  metric_name: 'lfc_chunk_size',\n  type: 'gauge',\n  help: 'LFC chunk size, measured in 8KiB pages',\n  key_labels: null"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_chunk_size.sql",
    "chars": 113,
    "preview": "SELECT lfc_value AS lfc_chunk_size_pages FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_chunk_size_pages';\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_hits.libsonnet",
    "chars": 169,
    "preview": "{\n  metric_name: 'lfc_hits',\n  type: 'gauge',\n  help: 'lfc_hits',\n  key_labels: null,\n  values: [\n    'lfc_hits',\n  ],\n "
  },
  {
    "path": "compute/etc/sql_exporter/lfc_hits.sql",
    "chars": 89,
    "preview": "SELECT lfc_value AS lfc_hits FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_hits';\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_misses.libsonnet",
    "chars": 177,
    "preview": "{\n  metric_name: 'lfc_misses',\n  type: 'gauge',\n  help: 'lfc_misses',\n  key_labels: null,\n  values: [\n    'lfc_misses',\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_misses.sql",
    "chars": 93,
    "preview": "SELECT lfc_value AS lfc_misses FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_misses';\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_used.libsonnet",
    "chars": 190,
    "preview": "{\n  metric_name: 'lfc_used',\n  type: 'gauge',\n  help: 'LFC chunks used (chunk = 1MB)',\n  key_labels: null,\n  values: [\n "
  },
  {
    "path": "compute/etc/sql_exporter/lfc_used.sql",
    "chars": 89,
    "preview": "SELECT lfc_value AS lfc_used FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_used';\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_used_pages.libsonnet",
    "chars": 193,
    "preview": "{\n  metric_name: 'lfc_used_pages',\n  type: 'gauge',\n  help: 'LFC pages used',\n  key_labels: null,\n  values: [\n    'lfc_u"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_used_pages.sql",
    "chars": 101,
    "preview": "SELECT lfc_value AS lfc_used_pages FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_used_pages';\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_writes.libsonnet",
    "chars": 177,
    "preview": "{\n  metric_name: 'lfc_writes',\n  type: 'gauge',\n  help: 'lfc_writes',\n  key_labels: null,\n  values: [\n    'lfc_writes',\n"
  },
  {
    "path": "compute/etc/sql_exporter/lfc_writes.sql",
    "chars": 93,
    "preview": "SELECT lfc_value AS lfc_writes FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_writes';\n"
  },
  {
    "path": "compute/etc/sql_exporter/logical_slot_restart_lsn.libsonnet",
    "chars": 359,
    "preview": "// Number of slots is limited by max_replication_slots, so collecting position\n// for all of them shouldn't be bad.\n\n{\n "
  },
  {
    "path": "compute/etc/sql_exporter/logical_slot_restart_lsn.sql",
    "chars": 140,
    "preview": "SELECT slot_name, (restart_lsn - '0/0')::pg_catalog.FLOAT8 AS restart_lsn\nFROM pg_catalog.pg_replication_slots\nWHERE slo"
  },
  {
    "path": "compute/etc/sql_exporter/max_cluster_size.libsonnet",
    "chars": 214,
    "preview": "{\n  metric_name: 'max_cluster_size',\n  type: 'gauge',\n  help: 'neon.max_cluster_size setting',\n  key_labels: null,\n  val"
  },
  {
    "path": "compute/etc/sql_exporter/max_cluster_size.sql",
    "chars": 118,
    "preview": "SELECT setting::pg_catalog.int4 AS max_cluster_size FROM pg_catalog.pg_settings WHERE name = 'neon.max_cluster_size';\n"
  },
  {
    "path": "compute/etc/sql_exporter/neon_perf_counters.sql",
    "chars": 888,
    "preview": "WITH c AS (SELECT pg_catalog.jsonb_object_agg(metric, value) jb FROM neon.neon_perf_counters)\n\nSELECT d.* FROM pg_catalo"
  },
  {
    "path": "compute/etc/sql_exporter/pageserver_disconnects_total.libsonnet",
    "chars": 232,
    "preview": "{\n  metric_name: 'pageserver_disconnects_total',\n  type: 'counter',\n  help: 'Number of times that the connection to the "
  },
  {
    "path": "compute/etc/sql_exporter/pageserver_open_requests.libsonnet",
    "chars": 197,
    "preview": "{\n  metric_name: 'pageserver_open_requests',\n  type: 'gauge',\n  help: 'Number of open requests to PageServer',\n  values:"
  },
  {
    "path": "compute/etc/sql_exporter/pageserver_requests_sent_total.libsonnet",
    "chars": 247,
    "preview": "{\n  metric_name: 'pageserver_requests_sent_total',\n  type: 'counter',\n  help: 'Number of all requests sent to the pagese"
  },
  {
    "path": "compute/etc/sql_exporter/pageserver_send_flushes_total.libsonnet",
    "chars": 218,
    "preview": "{\n  metric_name: 'pageserver_send_flushes_total',\n  type: 'counter',\n  help: 'Number of flushes to the pageserver connec"
  },
  {
    "path": "compute/etc/sql_exporter/pg_stats_userdb.libsonnet",
    "chars": 327,
    "preview": "{\n  metric_name: 'pg_stats_userdb',\n  type: 'gauge',\n  help: 'Stats for several oldest non-system dbs',\n  key_labels: [\n"
  },
  {
    "path": "compute/etc/sql_exporter/pg_stats_userdb.sql",
    "chars": 607,
    "preview": "-- We export stats for 10 non-system databases. Without this limit it is too\n-- easy to abuse the system by creating lot"
  },
  {
    "path": "compute/etc/sql_exporter/replication_delay_bytes.libsonnet",
    "chars": 245,
    "preview": "{\n  metric_name: 'replication_delay_bytes',\n  type: 'gauge',\n  help: 'Bytes between received and replayed LSN',\n  key_la"
  },
  {
    "path": "compute/etc/sql_exporter/replication_delay_bytes.sql",
    "chars": 396,
    "preview": "-- We use a GREATEST call here because this calculation can be negative. The\n-- calculation is not atomic, meaning after"
  },
  {
    "path": "compute/etc/sql_exporter/replication_delay_seconds.libsonnet",
    "chars": 244,
    "preview": "{\n  metric_name: 'replication_delay_seconds',\n  type: 'gauge',\n  help: 'Time since last LSN was replayed',\n  key_labels:"
  },
  {
    "path": "compute/etc/sql_exporter/replication_delay_seconds.sql",
    "chars": 246,
    "preview": "SELECT\n  CASE\n    WHEN pg_catalog.pg_last_wal_receive_lsn() = pg_catalog.pg_last_wal_replay_lsn() THEN 0\n    ELSE GREATE"
  },
  {
    "path": "compute/etc/sql_exporter/retained_wal.libsonnet",
    "chars": 233,
    "preview": "{\n  metric_name: 'retained_wal',\n  type: 'gauge',\n  help: 'Retained WAL in inactive replication slots',\n  key_labels: [\n"
  },
  {
    "path": "compute/etc/sql_exporter/retained_wal.sql",
    "chars": 305,
    "preview": "SELECT\n  slot_name,\n  pg_catalog.pg_wal_lsn_diff(\n    CASE\n      WHEN pg_catalog.pg_is_in_recovery() THEN pg_catalog.pg_"
  },
  {
    "path": "compute/etc/sql_exporter/wal_is_lost.libsonnet",
    "chars": 242,
    "preview": "{\n  metric_name: 'wal_is_lost',\n  type: 'gauge',\n  help: 'Whether or not the replication slot wal_status is lost',\n  key"
  },
  {
    "path": "compute/etc/sql_exporter/wal_is_lost.sql",
    "chars": 133,
    "preview": "SELECT\n  slot_name,\n  CASE\n    WHEN wal_status = 'lost' THEN 1\n    ELSE 0\n  END AS wal_is_lost\nFROM pg_catalog.pg_replic"
  },
  {
    "path": "compute/etc/sql_exporter.jsonnet",
    "chars": 1949,
    "preview": "function(collector_name, collector_file, connection_string) {\n  // Configuration for sql_exporter for autoscaling-agent\n"
  },
  {
    "path": "compute/jsonnet/neon.libsonnet",
    "chars": 598,
    "preview": "local MIN_SUPPORTED_VERSION = 14;\nlocal MAX_SUPPORTED_VERSION = 17;\nlocal SUPPORTED_VERSIONS = std.range(MIN_SUPPORTED_V"
  },
  {
    "path": "compute/manifest.schema.json",
    "chars": 7136,
    "preview": "{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"title\": \"Neon Compute Manifest Schema\",\n  \"description"
  },
  {
    "path": "compute/manifest.yaml",
    "chars": 6430,
    "preview": "pg_settings:\n  # Common settings for primaries and replicas of all versions.\n  common:\n    # Check for client disconnect"
  },
  {
    "path": "compute/patches/anon_v2.patch",
    "chars": 4877,
    "preview": "diff --git a/sql/anon.sql b/sql/anon.sql\nindex 0cdc769..5eab1d6 100644\n--- a/sql/anon.sql\n+++ b/sql/anon.sql\n@@ -1141,3 "
  },
  {
    "path": "compute/patches/cloud_regress_pg16.patch",
    "chars": 239344,
    "preview": "diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out\nindex 0c24f6afe4..dd808"
  },
  {
    "path": "compute/patches/cloud_regress_pg17.patch",
    "chars": 243673,
    "preview": "diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out\nindex 1c1ca7573a..6dfe5"
  },
  {
    "path": "compute/patches/contrib_pg16.patch",
    "chars": 10576,
    "preview": "diff --git a/contrib/amcheck/expected/check_heap.out b/contrib/amcheck/expected/check_heap.out\nindex 979e5e8..2375b45 10"
  },
  {
    "path": "compute/patches/contrib_pg17.patch",
    "chars": 8701,
    "preview": "diff --git a/contrib/amcheck/expected/check_heap.out b/contrib/amcheck/expected/check_heap.out\nindex 979e5e8..2375b45 10"
  },
  {
    "path": "compute/patches/duckdb_v113.patch",
    "chars": 716,
    "preview": "diff --git a/libduckdb.map b/libduckdb.map\nnew file mode 100644\nindex 0000000000..3b56f00cd7\n--- /dev/null\n+++ b/libduck"
  },
  {
    "path": "compute/patches/duckdb_v120.patch",
    "chars": 2204,
    "preview": "diff --git a/libduckdb_pg_duckdb.map b/libduckdb_pg_duckdb.map\nnew file mode 100644\nindex 0000000000..0872978b48\n--- /de"
  },
  {
    "path": "compute/patches/onnxruntime.patch",
    "chars": 1344,
    "preview": "diff --git a/cmake/deps.txt b/cmake/deps.txt\nindex d213b09034..229de2ebf0 100644\n--- a/cmake/deps.txt\n+++ b/cmake/deps.t"
  },
  {
    "path": "compute/patches/pg_cron.patch",
    "chars": 690,
    "preview": "commit b3ea51ee158f113f2f82d0b97c12c54343c9a695 (HEAD -> master)\nAuthor: Alexey Masterov <alexeymasterov@neon.tech>\nDate"
  },
  {
    "path": "compute/patches/pg_duckdb_v031.patch",
    "chars": 1708,
    "preview": "diff --git a/Makefile b/Makefile\nindex 3235cc8..6b892bc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -32,7 +32,7 @@ else\n \tDU"
  },
  {
    "path": "compute/patches/pg_graphql.patch",
    "chars": 587,
    "preview": "commit ec6a491d126882966a696f9ad5d3698935361d55\nAuthor: Alexey Masterov <alexeymasterov@neon.tech>\nDate:   Tue Dec 17 10"
  },
  {
    "path": "compute/patches/pg_hint_plan_v16.patch",
    "chars": 828,
    "preview": "diff --git a/expected/ut-A.out b/expected/ut-A.out\nindex da723b8..5328114 100644\n--- a/expected/ut-A.out\n+++ b/expected/"
  },
  {
    "path": "compute/patches/pg_hint_plan_v17.patch",
    "chars": 2594,
    "preview": "diff --git a/expected/ut-J.out b/expected/ut-J.out\nindex 2fa3c70..314e929 100644\n--- a/expected/ut-J.out\n+++ b/expected/"
  },
  {
    "path": "compute/patches/pg_repack.patch",
    "chars": 5020,
    "preview": "commit 5eb393810cf7c7bafa4e394dad2e349e2a8cb2cb\nAuthor: Alexey Masterov <alexey.masterov@databricks.com>\nDate:   Mon Jul"
  }
]

// ... and 1674 more files (download for full content)

About this extraction

This page contains the full source code of the neondatabase/neon GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1874 files (20.3 MB), approximately 4.0M tokens, and a symbol index with 12141 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!