Commit f0a0046
committed
Skip validation for ddocs in the scanner
Previously, if users had invalid ddocs in the cluster, for instance something
like `_design/`, the scanner would crash when tranforming them into `#doc{}`
records. That happened because the `couch_doc` function would automatically
revalidate them: check max doc length ID, attachments format, revision format,
doc ID format, etc. Which altogether silly, since they are already saved in our
cluster.
So, to avoid wasting resources revalidating existing documents, and crashing
the scanner process, use a much simpler function to transform the ddocs: make a
new `#doc{}` record with the ID and body by throwing away all the "special" doc
fields we don't care about (`_rev`, `_conflicts`, ...).1 parent f8e6c25 commit f0a0046
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
636 | 643 | | |
637 | 644 | | |
638 | 645 | | |
| |||
0 commit comments