Skip to content

Commit c1cc9a7

Browse files
committed
Remove footer from test output as pg17 contains Disabled: true|false
if enable_seqscan is set to false. Modify failing tests because of operator rewrite hook to not use <?> operator. Modify test output files accordingly.
1 parent 8ab9a61 commit c1cc9a7

28 files changed

+65
-372
lines changed

lantern_hnsw/src/hnsw/utils.c

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <assert.h>
77
#include <catalog/namespace.h>
88
#include <catalog/pg_proc.h>
9+
#include <catalog/pg_type_d.h>
910
#include <executor/spi.h>
1011
#include <math.h>
1112
#include <miscadmin.h>

lantern_hnsw/test/expected/async_tasks.out

-19
Original file line numberDiff line numberDiff line change
@@ -94,34 +94,29 @@ SELECT lantern.async_task($$SELECT pg_sleep(0.1);$$, 'Lantern job name');
9494
async_task
9595
------------
9696
1
97-
(1 row)
9897

9998
SELECT lantern.async_task($$SELECT pg_sleep(70);$$::text);
10099
async_task
101100
------------
102101
2
103-
(1 row)
104102

105103
-- will fail since the task is not valid SQL
106104
SELECT lantern.async_task($$SELECT pg_sleep(haha);$$, 'Lantern job name');
107105
async_task
108106
------------
109107
3
110-
(1 row)
111108

112109
SELECT jobid, query, pg_cron_job_name, job_name, duration IS NOT NULL AS is_done, status, error_message FROM lantern.tasks;
113110
jobid | query | pg_cron_job_name | job_name | is_done | status | error_message
114111
-------+------------------------+------------------+------------------+---------+--------+---------------
115112
1 | SELECT pg_sleep(0.1); | async_task_1 | Lantern job name | f | |
116113
2 | SELECT pg_sleep(70); | async_task_2 | | f | |
117114
3 | SELECT pg_sleep(haha); | async_task_3 | Lantern job name | f | |
118-
(3 rows)
119115

120116
SELECT pg_sleep(3);
121117
pg_sleep
122118
----------
123119

124-
(1 row)
125120

126121
SELECT jobid, query, pg_cron_job_name, job_name, duration IS NOT NULL AS is_done, status, error_message FROM lantern.tasks;
127122
jobid | query | pg_cron_job_name | job_name | is_done | status | error_message
@@ -132,13 +127,11 @@ SELECT jobid, query, pg_cron_job_name, job_name, duration IS NOT NULL AS is_done
132127
| | | | | | ^ +
133128
| | | | | |
134129
1 | SELECT pg_sleep(0.1); | async_task_1 | Lantern job name | t | succeeded |
135-
(3 rows)
136130

137131
SELECT lantern.cancel_all_async_tasks();
138132
cancel_all_async_tasks
139133
------------------------
140134

141-
(1 row)
142135

143136
-- test async tasks on index creation
144137
DROP TABLE IF EXISTS small_world;
@@ -156,29 +149,25 @@ SELECT lantern.async_task($$CREATE INDEX idx ON "sift_base1k_UpperCase" USING la
156149
async_task
157150
------------
158151
4
159-
(1 row)
160152

161153
-- blocks DB deletions that is why it is disabled for now
162154
-- SELECT lantern.async_task($$CREATE INDEX CONCURRENTLY idx_concurrent ON "sift_base1k_UpperCase" USING lantern_hnsw (v) WITH (dim=128, M=6);$$, 'Indexing Job');
163155
SELECT pg_sleep(5);
164156
pg_sleep
165157
----------
166158

167-
(1 row)
168159

169160
SELECT * FROM ldb_get_indexes('sift_base1k_UpperCase');
170161
indexname | size | indexdef | indisvalid
171162
-----------+--------+--------------------------------------------------------------------------------------------+------------
172163
idx | 632 kB | CREATE INDEX idx ON "sift_base1k_UpperCase" USING lantern_hnsw (v) WITH (dim='128', m='6') | t
173-
(1 row)
174164

175165
SELECT _lantern_internal.validate_index('idx', false);
176166
INFO: validate_index() start for idx
177167
INFO: validate_index() done, no issues found.
178168
validate_index
179169
----------------
180170

181-
(1 row)
182171

183172
SELECT jobid, query, pg_cron_job_name, job_name, duration IS NOT NULL AS is_done, status, error_message FROM lantern.tasks;
184173
jobid | query | pg_cron_job_name | job_name | is_done | status | error_message
@@ -190,7 +179,6 @@ SELECT jobid, query, pg_cron_job_name, job_name, duration IS NOT NULL AS is_done
190179
1 | SELECT pg_sleep(0.1); | async_task_1 | Lantern job name | t | succeeded |
191180
2 | SELECT pg_sleep(70); | async_task_2 | | t | canceled | Canceled by user
192181
4 | CREATE INDEX idx ON "sift_base1k_UpperCase" USING lantern_hnsw (v) WITH (dim=128, M=6); | async_task_4 | Indexing Job | t | succeeded |
193-
(4 rows)
194182

195183
-- NOTE: the test finishes but the async index creation may still be in progress
196184
-- create non superuser and test the function
@@ -207,14 +195,12 @@ NOTICE: Job scheduled with pg_cron name: 'async_task_5'
207195
async_task
208196
------------
209197
5
210-
(1 row)
211198

212199
SELECT lantern.async_task($$CREATE INDEX idx2 ON "sift_base1k_UpperCase" USING lantern_hnsw (v) WITH (dim=128, M=6);$$, 'Indexing Job');
213200
NOTICE: Job scheduled with pg_cron name: 'async_task_6'
214201
async_task
215202
------------
216203
6
217-
(1 row)
218204

219205
-- this should fail since test_user does not have permission to drop the table
220206
-- sql line for do not stop on error
@@ -223,28 +209,24 @@ NOTICE: Job scheduled with pg_cron name: 'async_task_7'
223209
async_task
224210
------------
225211
7
226-
(1 row)
227212

228213
-- lantern.tasks jobid is distinct and independent from cron.jobid, even though they may often overlap
229214
-- make sure everything works even when they are out of sync
230215
SELECT nextval('lantern.tasks_jobid_seq');
231216
nextval
232217
---------
233218
8
234-
(1 row)
235219

236220
SELECT lantern.async_task($$SELECT 42$$, 'Life');
237221
NOTICE: Job scheduled with pg_cron name: 'async_task_9'
238222
async_task
239223
------------
240224
9
241-
(1 row)
242225

243226
SELECT pg_sleep(4);
244227
pg_sleep
245228
----------
246229

247-
(1 row)
248230

249231
SELECT jobid, query, pg_cron_job_name, job_name, duration IS NOT NULL AS is_done, status, error_message FROM lantern.tasks ORDER BY jobid;
250232
jobid | query | pg_cron_job_name | job_name | is_done | status | error_message
@@ -255,5 +237,4 @@ SELECT jobid, query, pg_cron_job_name, job_name, duration IS NOT NULL AS is_done
255237
7 | DROP TABLE "sift_base1k_UpperCase"; | async_task_7 | Dropping Table Job | t | failed | ERROR: must be owner of table sift_base1k_UpperCase+
256238
| | | | | |
257239
9 | SELECT 42 | async_task_9 | Life | t | succeeded |
258-
(4 rows)
259240

lantern_hnsw/test/expected/ext_relocation.out

-7
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ ORDER BY 1, 3, 2;
6363
schema1 | ldb_pqvec_send | schema1
6464
schema1 | quantize_table | schema1
6565
schema1 | quantize_vector | schema1
66-
(29 rows)
6766

6867
-- show all the extension operators
6968
SELECT ne.nspname AS extschema, op.oprname, np.nspname AS proschema
@@ -81,15 +80,13 @@ ORDER BY 1, 3;
8180
schema1 | <-> | schema1
8281
schema1 | <=> | schema1
8382
schema1 | <+> | schema1
84-
(5 rows)
8583

8684
SET search_path TO public, schema1;
8785
-- extension function is accessible
8886
SELECT l2sq_dist(ARRAY[1.0, 2.0, 3.0], ARRAY[4.0, 5.0, 6.0]);
8987
l2sq_dist
9088
-----------
9189
27
92-
(1 row)
9390

9491
CREATE INDEX hnsw_index ON small_world USING lantern_hnsw(v) WITH (dim=3);
9592
INFO: done init usearch index
@@ -101,7 +98,6 @@ INFO: validate_index() done, no issues found.
10198
validate_index
10299
----------------
103100

104-
(1 row)
105101

106102
\set ON_ERROR_STOP off
107103
-- lantern does not support relocation.
@@ -127,7 +123,6 @@ ORDER BY 1, 3;
127123
schema1 | <-> | schema1
128124
schema1 | <=> | schema1
129125
schema1 | <+> | schema1
130-
(5 rows)
131126

132127
SET search_path TO public, schema2;
133128
--extension access method is still accessible since access methods are not schema-qualified
@@ -141,7 +136,6 @@ INFO: validate_index() done, no issues found.
141136
validate_index
142137
----------------
143138

144-
(1 row)
145139

146140
\set ON_ERROR_STOP off
147141
-- extension function cannot be found without schema-qualification
@@ -152,5 +146,4 @@ SELECT schema1.l2sq_dist(ARRAY[1.0, 2.0, 3.0], ARRAY[4.0, 5.0, 6.0]);
152146
l2sq_dist
153147
-----------
154148
27
155-
(1 row)
156149

lantern_hnsw/test/expected/hnsw_concurrent.out

-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ SELECT id, ROUND((v <-> :'v444')::numeric, 2) FROM sift_base1k ORDER BY v <-> :'
1515
557 | 91664.00
1616
62 | 93497.00
1717
58 | 93637.00
18-
(6 rows)
1918

2019
CREATE INDEX to_be_reindexed ON sift_base1k USING lantern_hnsw (v) WITH (dim=128, M=8);
2120
INFO: done init usearch index
@@ -25,15 +24,13 @@ SELECT * FROM ldb_get_indexes('sift_base1k');
2524
indexname | size | indexdef | indisvalid
2625
-----------------+--------+--------------------------------------------------------------------------------------------+------------
2726
to_be_reindexed | 680 kB | CREATE INDEX to_be_reindexed ON sift_base1k USING lantern_hnsw (v) WITH (dim='128', m='8') | t
28-
(1 row)
2927

3028
SELECT _lantern_internal.validate_index('to_be_reindexed', false);
3129
INFO: validate_index() start for to_be_reindexed
3230
INFO: validate_index() done, no issues found.
3331
validate_index
3432
----------------
3533

36-
(1 row)
3734

3835
REINDEX INDEX CONCURRENTLY to_be_reindexed;
3936
INFO: done init usearch index
@@ -46,13 +43,11 @@ INFO: validate_index() done, no issues found.
4643
validate_index
4744
----------------
4845

49-
(1 row)
5046

5147
SELECT * FROM ldb_get_indexes('sift_base1k');
5248
indexname | size | indexdef | indisvalid
5349
-----------------+--------+--------------------------------------------------------------------------------------------+------------
5450
to_be_reindexed | 680 kB | CREATE INDEX to_be_reindexed ON sift_base1k USING lantern_hnsw (v) WITH (dim='128', m='8') | t
55-
(1 row)
5651

5752
set enable_seqscan=FALSE;
5853
-- 6 closest vectors to the vector with ID 444. note all the duplicate results because of bad handling of REINDEX
@@ -65,5 +60,4 @@ SELECT id, ROUND((v <-> :'v444')::numeric, 2) FROM sift_base1k ORDER BY v <-> :'
6560
557 | 91664.00
6661
62 | 93497.00
6762
58 | 93637.00
68-
(6 rows)
6963

lantern_hnsw/test/expected/hnsw_config.out

-5
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,26 @@ SELECT * FROM ldb_get_indexes('small_world');
2727
indexname | size | indexdef | indisvalid
2828
-------------------+-------+-------------------------------------------------------------------------------------+------------
2929
small_world_v_idx | 16 kB | CREATE INDEX small_world_v_idx ON small_world USING lantern_hnsw (v) WITH (dim='3') | t
30-
(1 row)
3130

3231
-- Verify that lantern_hnsw.init_k exists after index creation
3332
SHOW lantern_hnsw.init_k;
3433
lantern_hnsw.init_k
3534
---------------------
3635
10
37-
(1 row)
3836

3937
-- Modify lantern_hnsw.init_k and verify that it was modified
4038
SET lantern_hnsw.init_k = 45;
4139
SHOW lantern_hnsw.init_k;
4240
lantern_hnsw.init_k
4341
---------------------
4442
45
45-
(1 row)
4643

4744
-- Reset all parameters and verify that lantern_hnsw.init_k was reset
4845
RESET ALL;
4946
SHOW lantern_hnsw.init_k;
5047
lantern_hnsw.init_k
5148
---------------------
5249
10
53-
(1 row)
5450

5551
-- Validate the index data structures
5652
SELECT _lantern_internal.validate_index('small_world_v_idx', false);
@@ -59,5 +55,4 @@ INFO: validate_index() done, no issues found.
5955
validate_index
6056
----------------
6157

62-
(1 row)
6358

lantern_hnsw/test/expected/hnsw_correct.out

-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ WHERE
4646
a.id != b.id;
4747
row_num | id_with_index | id_without_index | dist_with_index | dist_without_index
4848
---------+---------------+------------------+-----------------+--------------------
49-
(0 rows)
5049

5150
-- Validate the index data structures
5251
SELECT _lantern_internal.validate_index('small_world_v_idx', false);
@@ -55,5 +54,4 @@ INFO: validate_index() done, no issues found.
5554
validate_index
5655
----------------
5756

58-
(1 row)
5957

0 commit comments

Comments
 (0)