You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Indexer options to commit/cancel single crawl (#978)
Add a --commitCrawlId and --cancelCrawlId to indexer which will either:
- merge the the data for a single crawl into the main index. This can
take a variable amount of time, depending on size of index.
- improved logging for commit, and ensure counts are never incremented
twice, even if long-running commit job is restarted.
- delete data for canceled crawl from uncommitted crawls list (should be
very fast).
Both of these tasks also done as part of the crawl itself, and is still
useful for single-crawler operation. However, with Browsertrix
controlled in k8s, these tasks are better handled as separate jobs,
especially since crawl may be committed without restarting the crawler
container (eg. for paused crawls).
---------
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Copy file name to clipboardExpand all lines: docs/docs/develop/dedupe.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,8 @@ to the merged index. The following key is used to track uncomitted crawls:
49
49
50
50
If a crawl is canceled, these 3 keys should be removed and the crawl id should be removed from `uncommittedcrawls`
51
51
52
+
The indexer entrypoint includes a dedicated `indexer --cancelCrawlId <crawlid>` option to perform the cancellation operation.
53
+
52
54
### Committed Crawls / Merged Index Keys
53
55
54
56
Once a crawl is finished, the merged index keys are updated as follows:
@@ -60,6 +62,9 @@ Once a crawl is finished, the merged index keys are updated as follows:
60
62
61
63
-`allcounts`: A sum of all the `h:${crawlid}:counts` for all crawlids in `allcrawls`. The `allcounts` fields are incremented by each new `h:${crawlid}:counts`
62
64
65
+
Committing the crawl may take a long time, depending on the size of the crawl. For this reason, the indexer entrypoint
66
+
includes a dedicated command to commit a single crawl, `indexer --commitCrawlId <crawlid>`.
67
+
63
68
#### Dedupe Lookup
64
69
65
70
To write a revisit record, two Redis lookups are needed:
@@ -126,6 +131,13 @@ the existing crawls, by rerunning the crawl 'commit' process for each existing c
126
131
127
132
The result is that all data related to removed crawls is purged, and the `removeCrawlSize` and `removeCrawls` counts are reset to 0.
128
133
134
+
### Committing and Canceling
135
+
136
+
The indexer entrypoint also includes options to commit or cancel a crawl, as explained above. These options,
137
+
`--commitCrawlId <crawlid>` and `--cancelCrawlId <crawlid>` are useful when the crawler is controlled via k8s, e.g. with `--restartsOnError` set.
138
+
139
+
When the `--restartsOnError` flag is set, it is expected that the commit/cancel operations will be run separately, and so they are not run as part of the crawl. Otherwise, they are attempted as part of the crawl (after WACZ upload or upon cancellation).
140
+
129
141
## Crawl Dependency Tracking in WACZ datapackage.json
130
142
131
143
Deduplication adds an inherent dependency system, where a WACZ from one crawl (which contains `revisit` records) is now dependent on a WACZ from another crawl (which contains the original `response` records).
0 commit comments