Repository navigation
tests/mirror_diff: rules for 0.3.0; advisory, passing on the release pins - #205
Merged
Merged
Conversation
The known-differences list still described moonlink 0.2: its rules matched messages moonlink no longer prints, and 0.3's refusals and errored state had none, so a run failed about 200 checks for documented behavior. The list is rewritten against a full run on PostgreSQL 17: - Limitations, one rule each where possible: types mirrors cannot store, refused table shapes (unlogged, inheritance parents, generated columns, partitioned without a primary key), multi-dimensional arrays, numeric values beyond decimal(38, 10), NaN or Infinity, infinite dates and timestamps, source changes that error a mirror (TRUNCATE, a partition attached with rows, new inheritance children), char(n) padding, the scale of unconstrained numeric, and enum order. - Bugs that moonlink 0.3 fixed are gone, with the panic rules pinned to code locations that no longer exist. Unconstrained numeric values read back with 10 fractional digits. The comparator now checks that such values equal the heap's as numbers and reports them as a numeric-scale event, instead of a value difference a rule could only match by format. The unused summarize.py and the bug-id map option are removed. The README states that mirror_diff is advisory (its rules are measured on PostgreSQL 17), gives the measured run time, and links the renamed TESTING.md section. Co-authored-by: Isaac <no-reply@databricks.com>
…nces The numeric-scale comparison rounded to Decimal's 28-digit context, so two 30-digit values that differ in their last digit compared equal. It now compares exact values, only for unconstrained numeric and numeric[], and only when every differing mirror value is printed the way decimal(38, 10) prints it; 0 and -0.0000000000 differ. The char(n) padding rule accepted any value difference in a char(n) column. The comparator now reports a char-padding event when every differing mirror value is the heap's value without its trailing blanks, and the rule matches only that event. Every rule is anchored to the signature of the layer it reads (refusal, refused value, errored read, comparator event), the NaN and Infinity reasons apply to numeric columns only, and the two refused-type rules are one. Tests load the committed expected.txt and check that its rules match each documented limitation and leave other differences failing: a refusal of another type, a numeric-scale event on numeric(10,2), an unlisted out-of-sync reason, a char(n) difference that is not padding, and the 30-digit numeric. Co-authored-by: Isaac <no-reply@databricks.com>
zhousun
force-pushed
the
v0.3/16-mirror-diff-rules
branch
from
November 17, 2026 04:28
1f4583c to
0156707
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/mirror_diffruns the PostgreSQL regression suite against source tables and their mirrors. Its known-differences list still described moonlink 0.2: the rules matched messages moonlink no longer prints, and 0.3'screate_tablerefusals and errored state had no rules. A run on these pins therefore failed 211 checks for behavior the CHANGELOG documents.This rewrites
expected.txtagainst a full run (all layers, PostgreSQL 17.10 with assertions, moonlink 0e38b435). Every remaining difference is a documented limitation:decimal(38, 10), NaN and Infinity, and infinite dates and timestamps. Both the refusal atcreate_tableand the errored state after a later write match.Bugs that moonlink 0.3 fixed are removed, including the panic rules pinned to code locations that no longer exist.
Comparator events: two differences now get their own events, the way composites printed as STRUCT text already do, so their rules match only verified cases:
numeric-scale: unconstrained numeric values read back with 10 fractional digits (1as1.0000000000). The event is reported only fornumericandnumeric[]columns, and only when every differing mirror value is printed the waydecimal(38, 10)prints it and equals the heap's value exactly. The comparison has no rounding precision, and0and-0.0000000000differ.char-padding:char(n)values read back without their trailing blanks. The event is reported only when every differing mirror value is the heap's value without its trailing blanks.Any other difference in those columns is a plain value difference and fails.
Cleanup: the unused
summarize.pyand the bug-id map option are removed. The README now says mirror_diff is advisory, because its rules are measured on PostgreSQL 17 and don't cover other majors' regression files. It also gives the measured run time and links the renamed TESTING.md section.Testing
GATE mirror_diff PASS. It took about 45 minutes on 8 cores.python3 tests/mirror_diff/test_mirror_diff.pypasses (49 tests). It includes tests that load the committedexpected.txtand check that its rules match each documented limitation and leave other differences failing:hstoreornumeric(2,5);numeric-scaleevent onnumeric(10,2);char(n)difference that is not padding;This pull request and its description were written by Isaac.