Taimoor Zaeem and Steve Chavez
8cbcf9867b
feat: add config db-hoisted-tx-settings to allow only hoisted function settings
2024-05-21 19:50:03 -05:00
Taimoor Zaeem and Steve Chavez
a1582a6136
test: clean test_role_settings in io-tests
2024-05-21 19:50:03 -05:00
Taimoor Zaeem and Steve Chavez
5cc32c7f87
fix: fix incorrect 413 error on pg 54* errors
2024-05-20 18:59:33 -05:00
steve-chavez
7e61c9deb0
feat: force read-write for listener connection
2024-05-19 23:14:19 -05:00
steve-chavez
3cf565614d
fix: listener retries with exponential backoff
...
Also corrects the admin ready response which now considers the listener
state.
2024-05-19 20:48:59 -05:00
steve-chavez
bfa4e1bedb
test: isolate pg_terminate_backend to appname
...
The pg_terminate_backend done in the io test:
`test_fail_with_automatic_recovery_disabled_and_terminated_using_query`
Can affect other connections.
2024-05-19 19:58:27 -05:00
steve-chavez
ae91fd89b3
test: assert empty response text on 204
2024-05-19 13:44:23 -05:00
steve-chavez
d25df459ea
feat: add metric label for scache load
...
localhost:3001/metrics now includes:
pgrst_schema_cache_loads_total{status="FAIL"} 352.0
pgrst_schema_cache_loads_total{status="SUCCESS"} 3.0
This allows testing the failure case on:
https://github.com/PostgREST/postgrest/issues/3424#issuecomment-2104904910
2024-05-14 17:57:21 -05:00
Wolfgang Walther and Wolfgang Walther
71885bdba6
test: Avoid freeport() collisions in io tests
...
It's very unlikely, but it can (and did) happen that both the server and
admin ports have the same number returned from freeport(). This then
leads to a situation where PostgREST will accept the same port in both
cases, because the host "localhost" will allow binding to ipv4 or ipv6
respectively. This will make the IO tests fail.
This change makes sure that the admin port will never be the same as the
server port and thus avoids this problem.
2024-05-12 11:45:06 +02:00
Wolfgang Walther and Wolfgang Walther
8392357863
test: Fix internal_schema_cache_sleep after 747c78f6
...
The $subject commit broke internal_schema_cache_sleep for other tests.
This reverts the order change, but keeps the scaling by x1000 to ms and
thus changes other users of this setting to the new scale.
2024-05-12 11:44:43 +02:00
Wolfgang Walther
1fa35cb3b8
test: Fix coverage & style check from c4295b3d
2024-05-09 18:50:00 +02:00
Wolfgang Walther
01a56db7d8
test: Make unicode insert test work in parallel mode
...
Changing the PK here will avoid duplicate conflicts with another test.
References #1799
2024-05-09 18:05:44 +02:00
Wolfgang Walther
577a7c7598
test: Move limited delete/update tests into separate spec file
...
This potentially allows to run the remaining tests in those files in
parallel mode.
References #1799
2024-05-09 18:05:44 +02:00
Wolfgang Walther
c4295b3d63
test: Make PgSafeUpdateSpec parallel-ready
2024-05-09 18:05:44 +02:00
Wolfgang Walther
aa94e436fa
test: Missing space
2024-05-09 18:05:44 +02:00
Wolfgang Walther
cf7a789e9e
test: Improve failing test output for requestMutation
2024-05-09 18:05:44 +02:00
Wolfgang Walther
a7ed5db78a
test: Sort test suites in spec/Main.hs
2024-05-09 18:05:44 +02:00
Wolfgang Walther and Wolfgang Walther
747c78f6f4
test: Prevent test_admin_ready_includes_schema_cache_state from timing out
...
By increasing the delays in this test by factor 400x, postgrest will not
swamp pg with connection retries after the failed schema cache anymore.
This would happen because there is no backoff included after fatal
errors. Once it does, the io tests hang indefinitely in CI.
2024-05-09 13:36:03 +02:00
Wolfgang Walther and Wolfgang Walther
e96e16fa27
test: Reset statement timeout after each test
...
The statement timeout needs to be cleaned up after each test that
modifies it instead of before the test. Otherwise the changed timeout
leaks into other tests.
2024-05-09 13:36:03 +02:00
steve-chavez
0060abeb01
feat: /live and /ready respond with 500 on failure
...
503 is still used by /ready to indicate a transient state
that can be recovered from.
2024-05-08 17:19:48 -05:00
Taimoor Zaeem and Steve Chavez
21bc48ad9a
fix: fix wrong 503 Service Unavailable on pg error 53400
2024-05-06 07:54:11 -05:00
steve-chavez
d9a51f23ce
test: sanity tests for primary and replica
...
* new --replica option to `postgrest-with-postgresql-*`
* new command `postgrest-test-replica`
* new sanity tests on test_replica.py
* add postgrest-test-replica to postgrest-check and postgrest-coverage
2024-04-30 18:35:40 -05:00
steve-chavez
cdb877135b
test: flush stdout so readline doesn't hang
2024-04-30 13:52:51 -05:00
Laurence Isla and GitHub
69bbce5b32
feat: improve PGRST121 error message
...
* Clarify the message field
* Show failed MESSAGE or DETAIL in the the PGRST121 error's details field
* Show the correct JSON format in the hint field
2024-04-24 13:33:10 -05:00
steve-chavez
357400b2b8
feat: schema cache metrics
2024-04-23 19:08:37 -05:00
steve-chavez
653c7955b2
feat: connection pool metrics in admin server
2024-04-23 19:08:37 -05:00
steve-chavez
3e615bd0d9
feat: add log-level=debug
2024-04-22 21:36:29 -05:00
Taimoor Zaeem and Steve Chavez
88abf600c4
fix: fix wrong http status on pg error 42P17 infinite recursion
2024-04-22 13:40:07 -05:00
Wolfgang Walther
87a463f857
test: fix broken io tests after last commit
...
Forgot to update the snapshots.
2024-04-20 16:03:53 +02:00
Wolfgang Walther
ed407350ad
fix: hoist function settings with memory units properly
...
f9ee1f7e introduced the hoisting of function settings as transaction-scoped
settings. However, this currently doesn't work with memory units, which are
case-sensitive according to the docs [1]. This removes the lowercasing of
values to make them work.
This is not added to the CHANGELOG, because this feature was not released, yet.
[1]: https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-NAMES-VALUES
2024-04-20 13:58:04 +02:00
Laurence Isla and Steve Chavez
0d13b842a6
fix: OpenAPI now tags a FK correctly on O2O relationships
2024-04-18 17:08:14 -05:00
steve-chavez
1bf0c54dd6
feat: log connection pool events on log-level=info
2024-04-15 18:31:51 -05:00
Steve Chavez and GitHub
9d1dc783bf
test: use postgrest.read_stdout in io tests ( #3412 )
...
It's easier to maintain this way in case there are new log lines.
2024-04-15 13:51:23 -05:00
steve-chavez
69c6ce9c38
refactor: use LogLevel in Logger
...
* remove Logger dependency on Auth.
2024-04-14 20:10:01 -05:00
Taimoor Zaeem and Steve Chavez
973201a8d3
fix: remove rejected mediatype application/vnd.pgrst.object+json from response
2024-04-13 16:07:38 -05:00
steve-chavez
fbc4d565ca
refactor: move debounce from AppState to Logger
...
Will allow to capture accurate timeout metrics.
2024-04-12 14:29:39 -05:00
steve-chavez
2de32fc108
refactor: observation handler to AppConfig
...
With this:
- Is no longer necessary to pass observer as an argument
to every function that needs observations.
- We can invoke the observer on every function that uses AppConfig.
However it'd be better to just call the observer in the upper modules
(like on App.hs).
2024-04-12 14:29:39 -05:00
Laurence Isla and GitHub
460259548d
perf: fix space leaks by downgrading fuzzyset to v0.2.4
2024-04-11 14:13:20 -05:00
steve-chavez
3d55f77bae
Revert "fix: slow responses on schema cache reload"
...
This reverts commit 727ef465c1 .
Also documents requests waiting for the schema cache.
2024-04-02 23:15:09 -05:00
steve-chavez
2543b8d724
fix: clarify PGRST204 error message
2024-04-01 19:03:14 -05:00
Laurence Isla
378c11104b
test: fix some in-db config values
...
To correctly test in-db override of config file values, the former must be different from the latter.
2024-03-27 15:59:35 -05:00
Laurence Isla
428a6fef63
fix: in-db config values not loading for pgrst.server_trace_header and pgrst.server_cors_allowed_origins
2024-03-27 15:59:35 -05:00
steve-chavez
941ea0f929
test: notify do nothing
2024-03-19 13:22:51 +03:30
steve-chavez
ee8b3ef8fe
fix: log on LISTEN notification
2024-03-19 13:22:51 +03:30
steve-chavez
727ef465c1
fix: slow responses on schema cache reload
2024-03-15 11:53:29 -05:00
steve-chavez
11d8da046c
fix: incorrect /ready response on slow schema load
2024-03-15 11:03:01 -05:00
steve-chavez
4b289b1c97
test: requests wait for schema cache load
...
* nix: add postgrest-test-big-schema command
2024-03-15 06:18:26 -05:00
steve-chavez
92ac7e574e
chore: clarify concurrent notifications test
2024-03-14 23:17:05 -05:00
steve-chavez
ec7ab271d6
chore: add postgrest roles to big_schema.sql
2024-03-14 11:21:17 -05:00
Steve Chavez and GitHub
650249ed29
perf: remove json_typeof ( #3316 )
2024-03-08 16:02:28 -05:00