Add MIGRATION_NOTES.md: doc_id formula change 2026-03-13
Browse files- MIGRATION_NOTES.md +40 -0
MIGRATION_NOTES.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Migration Notes
|
| 2 |
+
|
| 3 |
+
## doc_id formula change — 2026-03-13
|
| 4 |
+
|
| 5 |
+
**Changed:** `doc_id` is now computed as `UUID5(NamespaceURL, url)` — a deterministic UUID derived from the canonical URL, stable across crawls and reruns.
|
| 6 |
+
|
| 7 |
+
**Before (shards below):** `doc_id` was the UUID extracted from the WARC-Record-ID header:
|
| 8 |
+
```
|
| 9 |
+
doc_id = TrimPrefix(warc_record_id, "<urn:uuid:") # e.g. <urn:uuid:abc-123> → abc-123
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
### Affected shards — CC-MAIN-2026-08 (232 shards, need re-export)
|
| 13 |
+
|
| 14 |
+
| Range | Count |
|
| 15 |
+
|---|---|
|
| 16 |
+
| 00000–00047 | 48 |
|
| 17 |
+
| 00058 | 1 |
|
| 18 |
+
| 00101–00148 | 48 |
|
| 19 |
+
| 00251–00291 | 41 |
|
| 20 |
+
| 00401–00424 | 24 |
|
| 21 |
+
| 00551–00562 | 12 |
|
| 22 |
+
| 00701–00720 | 20 |
|
| 23 |
+
| 00851–00888 | 38 |
|
| 24 |
+
| **Total** | **232** |
|
| 25 |
+
|
| 26 |
+
These shards will be re-exported automatically as the pipeline processes them again with `--republish`.
|
| 27 |
+
|
| 28 |
+
### Client-side workaround (no re-export needed)
|
| 29 |
+
|
| 30 |
+
The `url` column is correct and stable in **all** shards. Recompute `doc_id` client-side:
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
import uuid
|
| 34 |
+
doc_id = str(uuid.uuid5(uuid.NAMESPACE_URL, row["url"]))
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
```go
|
| 38 |
+
import "github.com/google/uuid"
|
| 39 |
+
docID := uuid.NewSHA1(uuid.NameSpaceURL, []byte(row.URL)).String()
|
| 40 |
+
```
|