- To check if a serverless index queries reflect recent writes to the index, check the log sequence number.
- To check whether an index contains recently inserted or deleted vectors, verify the number of vectors in the index.
Check the log sequence number
This method is only available for serverless indexes through the Database API.
Log sequence numbers
When you make a write request to a serverless index namespace, Pinecone assigns a monotonically increasing log sequence number (LSN) to the write operation. The LSN reflects upserts as well as updates and deletes to that namespace. Writes to one namespace do not increase the LSN for other namespaces. You can use LSNs to verify that specific write operations are reflected in your query responses. If the LSN contained in the query response header is greater than or equal to the LSN of the relevant write operation, then that operation is reflected in the query response. If the LSN contained in the query response header is greater than the LSN of the relevant write operation, then subsequent operations are also reflected in the query response. Follow the steps below to compare the LSNs for a write and a subsequent query.1. Get the LSN for a write operation
Every time you modify records in your namespace, the HTTP response contains the LSN for the upsert. This is contained in a header calledx-pinecone-request-lsn
.
The following example demonstrates how to get the LSN for an upsert
request using the curl
option -i
. This option tells curl to include headers in the displayed response. Use the same method to get the LSN for an update
or delete
request.
curl
curl
x-pinecone-max-indexed-lsn
is 4. This means that the index has performed 4 write operations since its creation.
2. Get the LSN for a query
Every time you query your index, the HTTP response contains the LSN for the query. This is contained in a header calledx-pinecone-max-indexed-lsn
.
By checking the LSN in your query results, you can confirm that the LSN is greater than or equal to the LSN of the relevant write operation, indicating that the results of that operation are present in the query results.
The following example makes a query
request to the index:
x-pinecone-max-indexed-lsn
is 5.