LNX: e9804944edc8a7c0af24ee3ba8397b87f1640b5f
I'm trying to figure out how to reproduce this. After the panic I reported in #18, after restarting lnx, I noticed that my index schema that was being returned from the search query was messed up. Searching seems to work as advertised (as in searching field_a:foo
, will return documents where foo
is set in field_a
, but the schema of the search results is messed up).
For example, let's say I have schema where I am only storing 3 fields (field_a
, field_b
, field_c
), but I am indexing 6. before the restart (example)
$ curl 'http://localhost:4040/indexes/posts/search?query=field_a:foo&mode=normal&limit=50&order_by=-ts'
{"data":{"count":40,"hits":[{"doc":{"field_a":["foo"],"field_b":[4],"field_c":[44]}, # etc
Now that same query is returning:
$ curl 'http://localhost:4040/indexes/posts/search?query=field_a:foo&mode=normal&limit=50&order_by=-ts'
{"data":{"count":40,"hits":[{"doc":{"field_d":["foo"],"field_e":[4],"field_f":[44]}, # etc
The values are correct, but the name of the keys are completely different.
However, in trying to reproduce the error, it seems like my lnx install is corrupted. I tried to to create an index like so:
{
"name": "corrupt",
"writer_buffer": 144000000,
"writer_threads": 12,
"reader_threads": 12,
"max_concurrency": 24,
"search_fields": [
"field_a"
],
"storage_type": "filesystem",
"set_conjunction_by_default": true,
"use_fast_fuzzy": false,
"strip_stop_words": false,
"fields": {
"field_a": {
"type": "text",
"stored": true
},
"field_b": {
"type": "u64",
"stored": true,
"indexed": true,
"fast": "single"
},
"field_c": {
"type": "u64",
"stored": true,
"indexed": true,
"fast": "single"
},
"field_d": {
"type": "text",
"stored": false
},
"field_e": {
"type": "text",
"stored": false
},
"field_f": {
"type": "text",
"stored": false
},
"version": {
"type": "u64",
"stored": false,
"indexed": true,
"fast": "single"
}
},
"boost_fields": {}
}
then index these documents:
[
{"field_a":["foo"], "field_b":[4], "field_c":[44], "field_d":["macbook"], "field_e":["apple"], "field_f":["iphone"], "version":[1]},
{"field_a":["bar"], "field_b":[5], "field_c":[55], "field_d":["laptop"], "field_e":["micrsoft"], "field_f":["galaxy"], "version":[2]},
{"field_a":["redbull coke"], "field_b":[6], "field_c":[66], "field_d":["thinkpad"], "field_e":["netflix"], "field_f":["nexus"], "version":[3]},
{"field_a":["vodka sprite"], "field_b":[7], "field_c":[77], "field_d":["ultrabook"], "field_e":["facebook"], "field_f":["blackberry"], "version":[4]},
{"field_a":["ginger ale whiskey"], "field_b":[8], "field_c":[88], "field_d":["chomebook"], "field_e":["google"], "field_f":["oneplus"], "version":[5]}
]
When I added them I got no error:
$ curl -X POST -d@corrupt_data.json -H "Content-Type: application/json" http://localhost:4040/indexes/corrupt/documents?wait=true
{"data":"added documents","status":200}
But in the lnx
logs I saw
Aug 30 01:23:56 torako lnx[635823]: [2021-08-30][01:23:56] | engine::index::writer | INFO - [ WRITER @ corrupt ][ TRANSACTION 0 ] completed operation ADD-DOCUMENT
Aug 30 01:23:56 torako lnx[635823]: [2021-08-30][01:23:56] | engine::index::writer | INFO - [ WRITER @ corrupt ][ TRANSACTION 1 ] completed operation ADD-DOCUMENT
Aug 30 01:23:56 torako lnx[635823]: [2021-08-30][01:23:56] | engine::index::writer | INFO - [ WRITER @ corrupt ][ TRANSACTION 2 ] completed operation ADD-DOCUMENT
Aug 30 01:23:56 torako lnx[635823]: [2021-08-30][01:23:56] | engine::index::writer | INFO - [ WRITER @ corrupt ][ TRANSACTION 3 ] completed operation ADD-DOCUMENT
Aug 30 01:23:56 torako lnx[635823]: [2021-08-30][01:23:56] | engine::index::writer | INFO - [ WRITER @ corrupt ][ TRANSACTION 4 ] completed operation ADD-DOCUMENT
Aug 30 01:23:56 torako lnx[635823]: thread 'thrd-tantivy-index3' panicked at 'Expected a u64/i64/f64 field, got Str("redbull coke") ', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tantivy-0.16.0/src/fastfield/mod.rs:208:14
Aug 30 01:23:56 torako lnx[635823]: stack backtrace:
Aug 30 01:23:56 torako lnx[635823]: 0: rust_begin_unwind
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
Aug 30 01:23:56 torako lnx[635823]: 1: std::panicking::begin_panic_fmt
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:457:5
Aug 30 01:23:56 torako lnx[635823]: 2: tantivy::indexer::index_writer::index_documents
Aug 30 01:23:56 torako lnx[635823]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aug 30 01:23:56 torako lnx[635823]: thread 'thrd-tantivy-index0' panicked at 'Expected a u64/i64/f64 field, got Str("foo") ', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tantivy-0.16.0/src/fastfield/mod.rs:208:14
Aug 30 01:23:56 torako lnx[635823]: stack backtrace:
Aug 30 01:23:56 torako lnx[635823]: 0: rust_begin_unwind
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
Aug 30 01:23:56 torako lnx[635823]: 1: std::thread 'panickingthrd-tantivy-index1::' panicked at 'begin_panic_fmtExpected a u64/i64/f64 field, got Str("bar")
Aug 30 01:23:56 torako lnx[635823]: ', at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tantivy-0.16.0/src/fastfield/mod.rs/rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs::208457::145
Aug 30 01:23:56 torako lnx[635823]: 2: tantivy::indexer::index_writer::index_documents
Aug 30 01:23:56 torako lnx[635823]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aug 30 01:23:56 torako lnx[635823]: stack backtrace:
Aug 30 01:23:56 torako lnx[635823]: 0: rust_begin_unwind
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
Aug 30 01:23:56 torako lnx[635823]: 1: std::panicking::begin_panic_fmt
Aug 30 01:23:56 torako lnx[635823]: at thread '/rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rsthrd-tantivy-index4:' panicked at '457Expected a u64/i64/f64 field, got Str("vodka sprite") :', 5/root/.cargo/registry/src/github.com-1ecc6299db9ec823/tantivy-0.16.0/src/fastfield/mod.rs
Aug 30 01:23:56 torako lnx[635823]: :208: 14
Aug 30 01:23:56 torako lnx[635823]: 2: tantivy::indexer::index_writer::index_documents
Aug 30 01:23:56 torako lnx[635823]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aug 30 01:23:56 torako lnx[635823]: stack backtrace:
Aug 30 01:23:56 torako lnx[635823]: thread 'thrd-tantivy-index2' panicked at 'Expected a u64/i64/f64 field, got Str("ginger ale whiskey") ', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tantivy-0.16.0/src/fastfield/mod.rs:208: 14
Aug 30 01:23:56 torako lnx[635823]: 0: rust_begin_unwind
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
Aug 30 01:23:56 torako lnx[635823]: 1: std::panicking::begin_panic_fmt
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:457:5
Aug 30 01:23:56 torako lnx[635823]: 2: tantivy::indexer::index_writer::index_documents
Aug 30 01:23:56 torako lnx[635823]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aug 30 01:23:56 torako lnx[635823]: stack backtrace:
Aug 30 01:23:56 torako lnx[635823]: 0: rust_begin_unwind
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
Aug 30 01:23:56 torako lnx[635823]: 1: std::panicking::begin_panic_fmt
Aug 30 01:23:56 torako lnx[635823]: at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:457:5
Aug 30 01:23:56 torako lnx[635823]: 2: tantivy::indexer::index_writer::index_documents
Aug 30 01:23:56 torako lnx[635823]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
I'm not sure if these two errors are related, but it seems lnx
's understanding of the fields and tanvity
's aren't in sync.