Slackbot
11/26/2023, 8:32 PMGreg Tappero
11/26/2023, 8:48 PMapp_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.174031 228 collection_manager.cpp:1438] Indexed 26126793/26126793 documents into collection companiesfr_alias_26112023_37017
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.181952 228 collection_manager.cpp:255] Loaded 4 collection(s) so far
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200186 192 collection_manager.cpp:316] Loaded 4 collection(s).
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200690 192 collection_manager.cpp:320] Initializing batched indexer from snapshot state...
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200733 192 batched_indexer.cpp:447] Restored 0 in-flight requests from snapshot.
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200742 192 raft_server.cpp:515] Finished loading collections from disk.
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200764 192 raft_server.h:283] Configuration of this group is 10.0.5.23:8107:8108
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.202894 192 snapshot_executor.cpp:264] node default_group:10.0.5.24:8107:8108 snapshot_load_done, last_included_index: 21709 last_included_term: 4 peers: "10.0.5.23:8107:8108"
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.203541 166 raft_meta.cpp:521] Loaded single stable meta, path /data/state/meta term 4 votedfor 10.0.5.23:8107:8108 time: 456
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.203580 166 node.cpp:608] node default_group:10.0.5.24:8107:8108 init, term: 4 last_log_id: (index=29035,term=4) conf: 10.0.5.23:8107:8108 old_conf:
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.203622 166 raft_server.cpp:134] Node last_index: 29035
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.174031 228 collection_manager.cpp:1438] Indexed 26126793/26126793 documents into collection companiesfr_alias_26112023_37017
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.181952 228 collection_manager.cpp:255] Loaded 4 collection(s) so far
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200186 192 collection_manager.cpp:316] Loaded 4 collection(s).
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200690 192 collection_manager.cpp:320] Initializing batched indexer from snapshot state...
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200733 192 batched_indexer.cpp:447] Restored 0 in-flight requests from snapshot.
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200742 192 raft_server.cpp:515] Finished loading collections from disk.
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.200764 192 raft_server.h:283] Configuration of this group is 10.0.5.23:8107:8108
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.202894 192 snapshot_executor.cpp:264] node default_group:10.0.5.24:8107:8108 snapshot_load_done, last_included_index: 21709 last_included_term: 4 peers: "10.0.5.23:8107:8108"
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.203541 166 raft_meta.cpp:521] Loaded single stable meta, path /data/state/meta term 4 votedfor 10.0.5.23:8107:8108 time: 456
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.203580 166 node.cpp:608] node default_group:10.0.5.24:8107:8108 init, term: 4 last_log_id: (index=29035,term=4) conf: 10.0.5.23:8107:8108 old_conf:
app_search.1.alz15ut0nvcg@formalist | I20231126 20:37:55.203622 166 raft_server.cpp:134] Node last_index: 29035
...
It keeps looping
app_search.1.alz15ut0nvcg@formalist | W20231126 20:43:15.263285 166 node.cpp:843] [default_group:10.0.5.24:8107:8108 ] Refusing concurrent configuration changing
app_search.1.alz15ut0nvcg@formalist | E20231126 20:43:15.263331 192 raft_server.h:62] Peer refresh failed, error: Doing another configuration change
app_search.1.alz15ut0nvcg@formalist | I20231126 20:43:17.284148 167 batched_indexer.cpp:285] Running GC for aborted requests, req map size: 157
app_search.1.alz15ut0nvcg@formalist | I20231126 20:43:25.264204 166 raft_server.cpp:564] Term: 6, last_index index: 29036, committed_index: 29036, known_applied_index: 21709, applying_index: 25020, queued_writes: 2083, pending_queue_size: 0, local_sequence: 108050116
app_search.1.alz15ut0nvcg@formalist | W20231126 20:43:25.264320 166 node.cpp:843] [default_group:10.0.5.24:8107:8108 ] Refusing concurrent configuration changing
app_search.1.alz15ut0nvcg@formalist | E20231126 20:43:25.264405 192 raft_server.h:62] Peer refresh failed, error: Doing another configuration change
app_search.1.alz15ut0nvcg@formalist | I20231126 20:43:35.267424 166 raft_server.cpp:564] Term: 6, last_index index: 29036, committed_index: 29036, known_applied_index: 21709, applying_index: 25108, queued_writes: 2140, pending_queue_size: 0, local_sequence: 108170796
app_search.1.alz15ut0nvcg@formalist | W20231126 20:43:35.267467 166 node.cpp:843] [default_group:10.0.5.24:8107:8108 ] Refusing concurrent configuration changing
app_search.1.alz15ut0nvcg@formalist | E20231126 20:43:35.267534 192 raft_server.h:62] Peer refresh failed, error: Doing another configuration change
app_search.1.alz15ut0nvcg@formalist | I20231126 20:43:45.268357 166 raft_server.cpp:564] Term: 6, last_index index: 29036, committed_index: 29036, known_applied_index: 21709, applying_index: 25115, queued_writes: 2153, pending_queue_size: 0, local_sequence: 108170810
app_search.1.alz15ut0nvcg@formalist | W20231126 20:43:45.268409 166 node.cpp:843] [default_group:10.0.5.24:8107:8108 ] Refusing concurrent configuration changing
app_search.1.alz15ut0nvcg@formalist | E20231126 20:43:45.268452 192 raft_server.h:62] Peer refresh failed, error: Doing another configuration change
app_search.1.alz15ut0nvcg@formalist | I20231126 20:43:55.269358 166 raft_server.cpp:564] Term: 6, last_index index: 29036, committed_index: 29036, known_applied_index: 21709, applying_index: 25118, queued_writes: 2153, pending_queue_size: 0, local_sequence: 108170816
app_search.1.alz15ut0nvcg@formalist | W20231126 20:43:55.269407 166 node.cpp:843] [default_group:10.0.5.24:8107:8108 ] Refusing concurrent configuration changing
app_search.1.alz15ut0nvcg@formalist | E20231126 20:43:55.269483 192 raft_server.h:62] Peer refresh failed, error: Doing another configuration change
Maybe a github issue is a better reporting place?
command: '--data-dir /data --api-key=${TYPESENSE_API_KEY} --num-documents-parallel-load=5000 --enable-cors --nodes=10.132.0.4 --healthy-read-lag=5000 --healthy-write-lag=10000 --cors-domains=http://localhost:8000'Jason Bosco
11/27/2023, 1:00 AMKishore Nallan
11/27/2023, 5:49 AMThis indicates that the node is catching up on 2153 write log entries. Once this value exceedsqueued_writes: 2153
healthy-read-lag the server starts returning 503 status code because the data is stale.Greg Tappero
11/27/2023, 5:52 AMGreg Tappero
11/27/2023, 5:55 AMpending_write_batches
{
"delete_latency_ms": 0,
"delete_requests_per_second": 0,
"import_latency_ms": 0,
"import_requests_per_second": 0,
"latency_ms": {},
"overloaded_requests_per_second": 0,
"pending_write_batches": 0,
"requests_per_second": {
"GET /collections": 0.1
},
"search_latency_ms": 0,
"search_requests_per_second": 0,
"total_requests_per_second": 0.1,
"write_latency_ms": 0,
"write_requests_per_second": 0
}
I will leave it for more hours and see.Kishore Nallan
11/27/2023, 5:55 AMGreg Tappero
11/27/2023, 5:57 AMdocker service logs app_search -f | grep queued_writes
Local sequence never decreases
ying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 138171202
app_search.1.8ptgu83qil7w@formalist | I20231127 05:40:59.644800 192 raft_server.h:60] Peer refresh succeeded!
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:09.645870 166 raft_server.cpp:564] Term: 6, last_index index: 29216, committed_index: 29216, known_applied_index: 29216, applying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 138171202
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:09.646028 192 raft_server.h:60] Peer refresh succeeded!
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:19.647183 166 raft_server.cpp:564] Term: 6, last_index index: 29216, committed_index: 29216, known_applied_index: 29216, applying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 138171202
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:19.647348 192 raft_server.h:60] Peer refresh succeeded!
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:21.810331 167 batched_indexer.cpp:285] Running GC for aborted requests, req map size: 0
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:29.648619 166 raft_server.cpp:564] Term: 6, last_index index: 29216, committed_index: 29216, known_applied_index: 29216, applying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 138171202
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:29.648821 192 raft_server.h:60] Peer refresh succeeded!
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:39.649920 166 raft_server.cpp:564] Term: 6, last_index index: 29216, committed_index: 29216, known_applied_index: 29216, applying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 138171202
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:39.650084 192 raft_server.h:60] Peer refresh succeeded!
app_search.1.8ptgu83qil7w@formalist | I20231127 05:41:49.651175 166 raft_server.cpp:564] Term: 6, last_index index: 29216, committed_index: 29216, known_applied_index: 29216, applying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 138171202Kishore Nallan
11/27/2023, 6:00 AMGreg Tappero
11/27/2023, 6:01 AMKishore Nallan
11/27/2023, 6:01 AMKishore Nallan
11/27/2023, 6:02 AMGreg Tappero
11/27/2023, 6:30 AMmeta db models state are at the root of the archive.
https://storage.googleapis.com/sg_public_usa/typesense_volume_fail_greg_20231127.tar.gzGreg Tappero
11/27/2023, 6:32 AMsearch:
image: typesense/typesense:0.25.1
restart: on-failure
volumes:
- /mnt/disks/typesense-data:/data
command: '--data-dir /data --api-key=${TYPESENSE_API_KEY} --num-documents-parallel-load=5000 --enable-cors --healthy-read-lag=5000 --healthy-write-lag=10000 --cors-domains=http://localhost:8000'
labels:
- "traefik.enable=true"
- traefik.http.services.search.loadbalancer.server.port=8108
networks:
- traefik-public
environment:
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- ....
deploy:
resources:
limits:
memory: 8GGreg Tappero
11/27/2023, 7:10 AMGreg Tappero
11/27/2023, 7:11 AMKishore Nallan
11/27/2023, 7:13 AMGreg Tappero
11/27/2023, 7:18 AMKishore Nallan
11/27/2023, 8:23 AMGreg Tappero
11/27/2023, 9:43 AMGreg Tappero
11/27/2023, 12:56 PM"pending_write_batches": 4541,
⢠Timeout on collection deletion
⢠cant push more data (probably the write health limit)
loop
I20231127 12:54:44.852870 10689 raft_server.h:60] Peer refresh succeeded!
I20231127 12:54:54.857040 10648 raft_server.cpp:564] Term: 6, last_index index: 5140, committed_index: 5140, known_applied_index: 5140, applying_index: 0, queued_writes: 4541, pending_queue_size: 0, local_sequence: 1034501
I20231127 12:54:54.857234 10687 raft_server.h:60] Peer refresh succeeded!
I20231127 12:55:03.539821 10649 batched_indexer.cpp:285] Running GC for aborted requests, req map size: 1
I20231127 12:55:04.861107 10648 raft_server.cpp:564] Term: 6, last_index index: 5140, committed_index: 5140, known_applied_index: 5140, applying_index: 0, queued_writes: 4541, pending_queue_size: 0, local_sequence: 1034501
I20231127 12:55:04.861287 10693 raft_server.h:60] Peer refresh succeeded!
I20231127 12:55:14.864997 10648 raft_server.cpp:564] Term: 6, last_index index: 5140, committed_index: 5140, known_applied_index: 5140, applying_index: 0, queued_writes: 4541, pending_queue_size: 0, local_sequence: 1034501
I20231127 12:55:14.865191 10689 raft_server.h:60] Peer refresh succeeded!Greg Tappero
11/27/2023, 12:56 PMKishore Nallan
11/27/2023, 1:41 PMGreg Tappero
11/27/2023, 1:49 PMresponses = client.collections[collection_name].documents.import_(
documents, {"action": "upsert", "dirty_values": "drop"}
)
@backoff.on_exception(
backoff.expo,
(requests.exceptions.RequestException, typesense.exceptions.TypesenseClientError),
max_tries=5,
)
def process_file_batch(file_paths, client, collection_name):
documents = []
for filename in file_paths:
with open(filename, "r") as file:
for line in file:
document = json.loads(line)
# convert any None to empty string
for key, value in document.items():
if value is None:
document[key] = ""
# add phonetic name
document["legal_name_phonetic"] = soundex(document["legal_name"]) if document["legal_name"] else ""
documents.append(document)
if not documents:
return 0
# Index documents to Typesense
responses = client.collections[collection_name].documents.import_(
documents, {"action": "upsert", "dirty_values": "drop"}
)
for response in responses:
if not response["success"]:
print("Error importing documents:", response)
return len(documents)
I can try single threaded.Kishore Nallan
11/27/2023, 1:51 PMGreg Tappero
11/27/2023, 1:54 PMKishore Nallan
11/27/2023, 2:08 PMGreg Tappero
11/27/2023, 2:14 PMKishore Nallan
11/27/2023, 2:17 PMGreg Tappero
11/27/2023, 2:18 PMKishore Nallan
11/27/2023, 2:19 PMGreg Tappero
11/27/2023, 2:20 PM"import_latency_ms": 7732.0,
"import_requests_per_second": 0.1,
"latency_ms": {
"GET /health": 0.0,
"GET /stats.json": 0.0,
"POST /collections/companiesfr_alias_27112023_55128/documents/import": 7732.0
},
This means that typesense takes 7s to receive the Payload (JSON) or that it take is 7seconds to ingest those documents?Kishore Nallan
11/27/2023, 2:21 PMGreg Tappero
11/27/2023, 4:44 PM[
{
"created_at": 1701094570,
"default_sorting_field": "",
"enable_nested_fields": true,
"fields": [
...
],
"name": "companiesfr_alias_27112023_55128",
"num_documents": 26126793,
"symbols_to_index": [],
"token_separators": []
}
]Greg Tappero
11/27/2023, 5:33 PMapp_search.1.s1lkz6iqyfmr@formalist | I20231127 16:57:32.738953 172 collection_manager.cpp:207] Loading upto 16 collections in parallel, 5000 documents at a time.
So far so good, doing more single threaded reindex.Kishore Nallan
11/28/2023, 1:47 AMGreg Tappero
11/28/2023, 10:23 AMdef create_companiesfr_collection(client, collection_name: str = "companiesfr"):
schema = {
"name": collection_name,
"enable_nested_fields": True,
"fields": [
{"name": "siren", "type": "string"},
{"name": "legal_name", "locale": "fr", "type": "string"},
{"name": "legal_name_phonetic", "locale": "fr", "type": "string"},
{"name": "entity_type", "type": "string", "facet": True},
],
}
Archive of export_data folder needed (Raw documents): https://storage.googleapis.com/sg_public_usa/export_data.gzip
Python script to launch the work: https://storage.googleapis.com/sg_public_usa/typesense_manager.py
Set NUMWOKERS to n
Set HOST to typesense server
python typesense_manager.py
Select option 5.Kishore Nallan
11/28/2023, 11:13 AMKishore Nallan
11/28/2023, 11:32 AMKishore Nallan
11/28/2023, 12:28 PMKishore Nallan
11/29/2023, 2:00 PMBATCH_SIZE value did you use when you ran on multiple processes?Kishore Nallan
11/29/2023, 2:00 PMGreg Tappero
11/29/2023, 6:43 PMKishore Nallan
11/30/2023, 9:55 AM0 for queued writes etc. so nothing was stuck. I wonder if the issue you faced was because of running into some limits like open files (ulimit) etc.Greg Tappero
12/10/2023, 7:54 PMKishore Nallan
12/11/2023, 3:19 PM