-
Notifications
You must be signed in to change notification settings - Fork 95
Registry slots not freed when BM25 indexes are dropped #83
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
When BM25 indexes are dropped, their Tapir registry slots are not freed. This prevents creating new indexes even after dropping old ones. A PostgreSQL restart is required to free the slots.
Environment
- PostgreSQL version: 18
- pg_textsearch version: 0.1.1-dev
- Operating system: Linux (Docker container)
Steps to Reproduce
- Create enough BM25 indexes to approach the registry limit (64 indexes)
- Drop several indexes
- Try to create new indexes
-- Create 5 test indexes
CREATE INDEX idx_test_1_bm25 ON my_table USING bm25 (title) WITH (text_config=english);
CREATE INDEX idx_test_2_bm25 ON my_table USING bm25 (title) WITH (text_config=english);
CREATE INDEX idx_test_3_bm25 ON my_table USING bm25 (title) WITH (text_config=english);
CREATE INDEX idx_test_4_bm25 ON my_table USING bm25 (title) WITH (text_config=english);
CREATE INDEX idx_test_5_bm25 ON my_table USING bm25 (title) WITH (text_config=english);
-- Drop all 5 indexes
DROP INDEX idx_test_1_bm25;
DROP INDEX idx_test_2_bm25;
DROP INDEX idx_test_3_bm25;
DROP INDEX idx_test_4_bm25;
DROP INDEX idx_test_5_bm25;
-- Try to create 5 new indexes
CREATE INDEX idx_test_new_1_bm25 ON my_table USING bm25 (title) WITH (text_config=english);
CREATE INDEX idx_test_new_2_bm25 ON my_table USING bm25 (title) WITH (text_config=english);
CREATE INDEX idx_test_new_3_bm25 ON my_table USING bm25 (title) WITH (text_config=english);Expected Behavior
After dropping indexes, their registry slots should be freed immediately, allowing new indexes to be created without a PostgreSQL restart.
Actual Behavior
New indexes cannot be created even though indexes were dropped. The registry still reports as full and creation fails with:
ERROR: Tapir registry full, cannot register index <oid>
Only a PostgreSQL restart clears the registry and allows new indexes to be created.
Test results:
- Started with 56 indexes (8 free slots)
- Created 5 test indexes → 61 indexes (3 free slots)
- Dropped 5 test indexes → 56 indexes (should have 8 free slots)
- Tried to create 5 new indexes → Only 2 succeeded, 3 failed with "Tapir registry full"
Additional Context
- Registry limit: 64 indexes
- Use case: Partitioned/hypertable with multiple chunks, requiring indexes on each chunk
- This prevents dynamic index management scenarios:
- Rolling index maintenance (dropping old indexes and creating new ones)
- Creating indexes on new partitions/chunks
- Managing indexes within a retention window
- Current workaround: Schedule PostgreSQL restarts to free registry slots, which is not ideal for production
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working