quickwit icon indicating copy to clipboard operation
quickwit copied to clipboard

key may not contain the 0 byte [redux]

Open kirse opened this issue 2 years ago • 3 comments

Describe the bug There appears to be a recent issue for this - #4915 - that is now closed, but I ran into it again while testing out quickwit for blockchain TX data. These TXs can be serialized to JSON, but also have some weird keys + binary data when serialized. See attached document samples.

sample-docs-and-index.zip

Repro works on both RHEL (Rocky Linux 9.0) and Ubuntu 24.04.

Steps to reproduce (if applicable)

Install Quickwit via the Quickstart instructions

curl -L https://install.quickwit.io | sh

Then:

# Run
./quickwit run
# Create bare minimum dynamic mode index - https://quickwit.io/docs/guides/schemaless#dynamic-mode
./quickwit index create --index-config mindex.yaml
# Works fine
./quickwit index ingest --index mindex --input-path TX-good.json --force
# Fails, have to CTRL+C
./quickwit index ingest --index mindex --input-path TX-with-bad-doc.json --force

At this point, logs show:

2024-07-13T20:07:04.444Z  INFO quickwit_indexing::actors::indexer: send-to-index-serializer index=mindex:01J2PV8VFMY05YY314REGRBVE4 source="_ingest-api-source" pipeline_uid=01J2PV8VFSVDCD5NN0HEM7356S commit_trigger=ForceCommit num_batches=1 split_ids=01J2PV9HZFQZFZHR8SZJC0STPX num_docs=6
2024-07-13T20:07:04.461Z  INFO index-doc-batches{index_id=mindex source_id=_ingest-api-source pipeline_uid=01J2PV8VFSVDCD5NN0HEM7356S workbench_id=01J2PV9HZFTAMN1XJDM4WSKSJT}:publisher{split_update=SplitsUpdate { index_id: "mindex", new_splits: "01J2PV9HZFQZFZHR8SZJC0STPX", checkpoint_delta: Some(_ingest-api-source:∆(ingest_partition_01J2PRP8SM82HZM24S2W4ZMJNZ:(..00000000000000000006])) }}: quickwit_indexing::actors::publisher: publish-new-splits new_splits=["01J2PV9HZFQZFZHR8SZJC0STPX"] checkpoint_delta=Some(_ingest-api-source:∆(ingest_partition_01J2PRP8SM82HZM24S2W4ZMJNZ:(..00000000000000000006]))
2024-07-13T20:07:47.491Z  INFO quickwit_indexing::actors::indexer: new-split split_id=01J2PVAW0VS28XW2254ZMYMWGG partition_id=0
thread 'blocking-0' panicked at /cargo/git/checkouts/tantivy-f70b7ea03dadae9a/67ebba3/columnar/src/columnar/writer/mod.rs:71:5:
key may not contain the 0 byte
stack backtrace:

After this point, any sort of further attempts to ingest docs fails for the mindex unless it's 1) deleted + re-created and 2) quickwit is restarted.

# Ex: This will now fail
./quickwit index ingest --index mindex --input-path TX-good.json --force
# Have to re-create index
./quickwit index delete --index mindex
./quickwit index create --index-config mindex.yaml
# Kill + restart quickwit
./quickwit run
# Then this works again:
./quickwit index ingest --index mindex --input-path TX-good.json --force

Expected behavior Quickwit fails on the document but recovers from the bad document or skips it entirely (vs. forever borking the index). Or some config option to skip non-serializable keys and partially-import the doc.

Configuration: Rocky Linux 9 + Ubuntu 24.04, vanilla minimal installs.

 ./quickwit --version
Quickwit 0.8.2 (x86_64-unknown-linux-gnu 2024-06-17T16:36:47Z 42766b8)

kirse avatar Jul 13 '24 20:07 kirse

quickwit 0.8.2 doesn't contain the fix for #4915 . I can reproduce the with the files your provided, for that release, but I can't with current main branch.

trinity-1686a avatar Jul 14 '24 11:07 trinity-1686a

\0 and \1 are forbidden in strings. In quickwit 0.9, we will simply dismiss these values at index time (and for fast fields), so they won't be searchable for instance.

fulmicoton avatar Jul 16 '24 02:07 fulmicoton

quickwit 0.8.2 doesn't contain the fix for #4915 . I can reproduce the with the files your provided, for that release, but I can't with current main branch.

Ah thanks, did not realize main was not aligned with the latest release. Using the edge Docker container also works here including some more complex test cases. Closing!

kirse avatar Jul 16 '24 06:07 kirse