pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: guzhoudiaoke (@guzhoudiaoke) <noreply+guzhoudiaoke@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #635: Whether we should lock element when UpdateNeighborsInMemory ?
Date: Sun, 04 Aug 2024 09:40:57 +0000
Message-ID: <gh-pgvector-pgvector-635-c2267466603@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-635@github.com>
References: <gh-pgvector-pgvector-635@github.com>

> Hi @guzhoudiaoke, thanks for reporting. I'm having trouble reproducing the crash, but it does seem possible depending on how the compiler decides to order the instructions (so I think additional locking is needed). A few questions:
> 
> 1. How often are you seeing the crash?

In fact, the trigger probability is not high, we meet once, then some reproduction methods were tried.
We found that set `max_parallel_maintenance_workers ` to a bigger value such as 20 can increase recurrence probability.
And also we found it often triggered at the beginning of hnsw index creation, so we reproduce the problem by constantly interrupting and restart to create the index (use Ctrl-C to stop and restart create index).


> 2. What compiler (including the version) are you using to build the extension?

```
gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

> 3. What flags are used to build `hnswbuild.c` and `vector.so` (from the `make` output)?

```
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-but-set-variable -Werror=implicit-fallthrough=3 -Wno-format-truncation -Wno-stringop-truncation -g -O0 -g2  -Werror=uninitialized -Werror=implicit-function-declaration -march=haswell -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -Wno-error=maybe-uninitialized -fPIC -I. -I. -I../../deps/root/include -I../../src/include   -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/hnswbuild.o src/hnswbuild.c -MMD -MP -MF .deps/hnswbuild.Po
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-but-set-variable -Werror=implicit-fallthrough=3 -Wno-format-truncation -Wno-stringop-truncation -g -O0 -g2  -Werror=uninitialized -Werror=implicit-function-declaration -march=haswell -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -Wno-error=maybe-uninitialized -fPIC -shared -o vector.so src/bitutils.o src/bitvec.o src/halfutils.o src/halfvec.o src/hnsw.o src/hnswbuild.o src/hnswinsert.o src/hnswscan.o src/hnswutils.o src/hnswvacuum.o src/ivfbuild.o src/ivfflat.o src/ivfinsert.o src/ivfkmeans.o src/ivfscan.o src/ivfutils.o src/ivfvacuum.o src/sparsevec.o src/vector.o -L../../src/port -L../../src/common -L../../deps/root/lib    -Wl,--as-needed -lxerces-c -Wl,-rpath,'/data/liuruyi/matrixdb/lib',--enable-new-dtags
```

view thread (11+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-635-c2267466603@github.com>
Permalink:  ../gh-pgvector-pgvector-635-c2267466603@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox