Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix issue with concurrent identical searches (Fixes #233), Change "log" level messaging to "debug1" (Fixes #242) #258

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3"
services:
pgstac:
container_name: pgstac
2 changes: 1 addition & 1 deletion docker/pypgstac/Dockerfile
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ FROM pyrustbase as pypgstac
COPY ./src/pypgstac/pyproject.toml /tmp/pyproject.toml
WORKDIR /tmp
RUN \
toml-to-req --include-optional \
toml-to-req --optional-lists test,build,dev,psycopg,migrations \
&& pip install -r /tmp/requirements.txt
COPY docker/pypgstac/bin /opt/docker/pypgstac/bin
COPY src/pypgstac /opt/src/pypgstac
6 changes: 3 additions & 3 deletions docker/pypgstac/bin/test
Original file line number Diff line number Diff line change
@@ -198,7 +198,7 @@ while [[ $# -gt 0 ]]
;;

--vv)
MESSAGELOG=1
MESSAGEDEBUG=1
shift
;;

@@ -255,8 +255,8 @@ while [[ $# -gt 0 ]]


CLIENTMESSAGES='warning'
[ $MESSAGENOTICE -eq 1 ] && CLIENTMESSAGES='notice'
[ $MESSAGELOG -eq 1 ] && CLIENTMESSAGES='log'
[[ $MESSAGENOTICE -eq 1 ]] && CLIENTMESSAGES='notice'
[[ $MESSAGEDEBUG -eq 1 ]] && CLIENTMESSAGES='debug1'
echo $CLIENTMESSAGES

if [[ ($FORMATTING -eq 0) && ($SETUPDB -eq 0) && ($PGTAP -eq 0) && ($BASICSQL -eq 0) && ($PYPGSTAC -eq 0) && ($MIGRATIONS -eq 0) ]]
453 changes: 446 additions & 7 deletions src/pgstac/migrations/pgstac.0.8.5-unreleased.sql

Large diffs are not rendered by default.

323 changes: 184 additions & 139 deletions src/pgstac/migrations/pgstac.unreleased.sql

Large diffs are not rendered by default.

325 changes: 185 additions & 140 deletions src/pgstac/sql/004_search.sql

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/pgstac/sql/006_tilesearch.sql
Original file line number Diff line number Diff line change
@@ -46,9 +46,9 @@ BEGIN
exitwhenfull := TRUE;
END IF;

SELECT * INTO search FROM searches WHERE hash=queryhash;
search := search_fromhash(queryhash);

IF NOT FOUND THEN
IF search IS NULL THEN
RAISE EXCEPTION 'Search with Query Hash % Not Found', queryhash;
END IF;

2 changes: 2 additions & 0 deletions src/pgstac/tests/basic/xyz_searches.sql
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@ SET pgstac."default_filter_lang" TO 'cql-json';

SELECT hash from search_query('{"collections":["pgstac-test-collection"]}');

SELECT hash, search, metadata FROM search_fromhash('2bbae9a0ef0bbb5ffaca06603ce621d7');

SELECT xyzsearch(8615, 13418, 15, '2bbae9a0ef0bbb5ffaca06603ce621d7', '{"include":["id"]}'::jsonb);

SELECT xyzsearch(1048, 1682, 12, '2bbae9a0ef0bbb5ffaca06603ce621d7', '{"include":["id"]}'::jsonb);
3 changes: 3 additions & 0 deletions src/pgstac/tests/basic/xyz_searches.sql.out
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@ SET
SELECT hash from search_query('{"collections":["pgstac-test-collection"]}');
2bbae9a0ef0bbb5ffaca06603ce621d7

SELECT hash, search, metadata FROM search_fromhash('2bbae9a0ef0bbb5ffaca06603ce621d7');
2bbae9a0ef0bbb5ffaca06603ce621d7 | {"collections": ["pgstac-test-collection"]} | {}

SELECT xyzsearch(8615, 13418, 15, '2bbae9a0ef0bbb5ffaca06603ce621d7', '{"include":["id"]}'::jsonb);
{"type": "FeatureCollection", "features": [{"id": "pgstac-test-item-0003", "collection": "pgstac-test-collection"}]}