Compare commits

...

12 Commits

Author SHA1 Message Date
BodoBolero
b774e1655d Revert "reduce number of stripe sizes tested and add a test for postgres version 17"
This reverts commit 4ab4510a84.
2025-01-27 10:49:56 +01:00
BodoBolero
4ab4510a84 reduce number of stripe sizes tested and add a test for postgres version 17 2025-01-27 10:23:51 +01:00
BodoBolero
6c0cf1c1cc fix matrix 2025-01-14 16:13:06 +01:00
BodoBolero
95d50f918a syntax error 2025-01-14 16:10:44 +01:00
BodoBolero
30ba4ac50b test different stripe sizes 2025-01-14 16:09:08 +01:00
BodoBolero
2aef4a93e0 naming convention 2025-01-14 11:49:06 +01:00
BodoBolero
6638abda65 test admin api key 2025-01-14 11:33:13 +01:00
BodoBolero
306017ebc7 try to sleep before shard splitting 2025-01-13 20:45:17 +01:00
BodoBolero
8467fe9b05 debug curl request 2025-01-13 20:36:02 +01:00
BodoBolero
08c2021881 debug curl 2025-01-13 20:22:16 +01:00
BodoBolero
4975dfd3cf add libpath 2025-01-13 20:03:36 +01:00
BodoBolero
5b26876ac7 test out different stripe size for ingest 2025-01-13 19:00:04 +01:00
6 changed files with 81 additions and 5 deletions

View File

@@ -17,6 +17,31 @@ inputs:
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, specify true to shard-split'
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'
outputs:
dsn:
@@ -63,6 +88,23 @@ runs:
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
env:
API_HOST: ${{ inputs.api_host }}
API_KEY: ${{ inputs.api_key }}
@@ -70,3 +112,9 @@ runs:
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 }}
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 }}

View File

@@ -28,7 +28,31 @@ jobs:
strategy:
fail-fast: false # allow other variants to continue even if one fails
matrix:
target_project: [new_empty_project, large_existing_project]
include:
- target_project: new_empty_project
stripe_size: 128 # 1 MiB
- target_project: new_empty_project
stripe_size: 256 # 2 MiB
- target_project: new_empty_project
stripe_size: 512 # 4 MiB
- target_project: new_empty_project
stripe_size: 1024 # 8 MiB
- target_project: new_empty_project
stripe_size: 2048 # 16 MiB
- target_project: new_empty_project
stripe_size: 4096 # 32 MiB
- target_project: new_empty_project
stripe_size: 8192 # 64 MiB
- target_project: new_empty_project
stripe_size: 16384 # 128 MiB
- target_project: new_empty_project
stripe_size: 32768 # 256 MiB # note that this is different from null because using null will shard_split the project only if it reaches the threshold
# while here it is sharded from the beginning with a shard size of 256 MiB
- target_project: new_empty_project
stripe_size: null # run with neon defaults which will shard split only when reaching the threshold
- target_project: large_existing_project
stripe_size: null # cannot re-shared or choose different stripe size for existing, already sharded project
max-parallel: 1 # we want to run each stripe size sequentially to be able to compare the results
permissions:
contents: write
statuses: write
@@ -75,6 +99,10 @@ jobs:
postgres_version: 16
compute_units: '[7, 7]' # we want to test large compute here to avoid compute-side bottleneck
api_key: ${{ secrets.NEON_STAGING_API_KEY }}
shard_split_project: ${{ matrix.stripe_size != null && 'true' || 'false' }}
admin_api_key: ${{ secrets.NEON_STAGING_ADMIN_API_KEY }}
shard_count: 8
stripe_size: ${{ matrix.stripe_size }}
- name: Initialize Neon project
if: ${{ matrix.target_project == 'new_empty_project' }}