exwiw 0.9.15 → 0.9.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/exwiw/adapter/mongodb_adapter.rb +17 -3
- data/lib/exwiw/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39d7f662c156d9cd897af698c86f2af772c5918dcfd4126d833d08294da7b840
|
|
4
|
+
data.tar.gz: 79c08139a1e9bd7cb90858cba0a28cd0f442770165f6fd54488d9ae8ab49546a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b3967012a3af6a90252a1c2d480d70aa9b7af6cd8824f73972b3d5efc0f1badf93cc43635c1b155201d1398279ffb40728c937df9f5f1544981e6ddcc6e1086
|
|
7
|
+
data.tar.gz: 0a0b8dafc3fb66166e09a208bfae07cc60251ddb8b6a6482ddb9eeb37355c176bfb019d02ebe546da211d33d8e64c77c63c03582c96b343d4408f82003472dc6
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.16] - 2026-07-31
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **MongoDB: a collection whose genuine (target-reachable) parents captured no ids now matches nothing instead of falling back to reference-parent constraints.** When the dump target legitimately owns no rows in a scoping chain (e.g. a just-created tenant with no rows in the anchor collection), the previous strict-AND fallback over reference parents — master data dumped in full — degenerated into a near-full-collection query: at best dumping cross-scope rows, at worst timing out or exceeding the BSON size limit on a large collection. Collections with no genuine parent at all (reachable only via reference data) keep the historical fallback.
|
|
10
|
+
|
|
5
11
|
## [0.9.15] - 2026-07-31
|
|
6
12
|
|
|
7
13
|
### Fixed
|
|
@@ -476,9 +476,13 @@ module Exwiw
|
|
|
476
476
|
# has a genuine parent to anchor on, reference-parent constraints are
|
|
477
477
|
# dropped entirely.
|
|
478
478
|
#
|
|
479
|
-
# When
|
|
480
|
-
#
|
|
481
|
-
#
|
|
479
|
+
# - When the collection DECLARES a genuine parent but none captured any id
|
|
480
|
+
# (the dump target legitimately owns no such rows — e.g. a tenant created
|
|
481
|
+
# moments ago), it matches nothing: reference-parent constraints do not
|
|
482
|
+
# narrow to the target, so falling back to them degenerates into a
|
|
483
|
+
# near-full-collection query. Only a collection with NO genuine parent at
|
|
484
|
+
# all (reachable only via reference data) keeps the historical strict-AND
|
|
485
|
+
# fallback.
|
|
482
486
|
#
|
|
483
487
|
# A belongs_to whose parent produced no ids contributes no constraint: either
|
|
484
488
|
# the parent matched nothing, or it is not dumped here (e.g. an embedded
|
|
@@ -520,6 +524,16 @@ module Exwiw
|
|
|
520
524
|
target << [relation.foreign_key, values]
|
|
521
525
|
end
|
|
522
526
|
|
|
527
|
+
if genuine_clauses.empty? && reference_clauses.any? && config.belongs_tos.any? { |r| genuine.include?(r.table_name) }
|
|
528
|
+
@logger.warn(
|
|
529
|
+
" Collection '#{config.name}' is scoped by genuine parent(s) that captured no ids " \
|
|
530
|
+
"for this dump target; constraining it to match no rows instead of falling back to " \
|
|
531
|
+
"reference-parent constraints (which do not narrow to the target and can devolve " \
|
|
532
|
+
"into a full-collection scan)."
|
|
533
|
+
)
|
|
534
|
+
return { config.primary_key => { "$in" => [] } }
|
|
535
|
+
end
|
|
536
|
+
|
|
523
537
|
filter =
|
|
524
538
|
if genuine_clauses.any?
|
|
525
539
|
anchor_index = (0...genuine_clauses.size).min_by { |i| genuine_clauses[i][1].size }
|
data/lib/exwiw/version.rb
CHANGED