View Issue Details

IDProjectCategoryView StatusLast Update
0006674SymmetricDS ProBugpublic2024-12-11 20:34
Reporterpbelov Assigned Topbelov  
Prioritynormal 
Status resolvedResolutionfixed 
Product Version3.15.0 
Target Version3.15.12Fixed in Version3.15.12 
Summary0006674: False conflict change detection on update of Null or Empty values in NVARCHAR(MAX) and VARCHAR(MAX) columns (SQLServer-specific)
DescriptionFalse-positive conflict change detection on update of Null or Empty values in NVARCHAR(MAX) and VARCHAR(MAX) columns (SQLServer-specific)
Affects SymmetricDS bi-directional replication with conflict resolution mode FALLBACK.
Affects LOB columns of the NVARCHAR(MAX) or VARCHAR(MAX) data types on MS SQL Server version 2005 and up.
Whenever an OLD_DATA for batch contains a blank or null value being replaced by a non-blank value, there is an additional (erroneous) change captured and sent as part of conflict resolution fallback, which sends blank value to the node on the opposite side of the group link.
Testing requires:
* MS SQL Server on both source and target nodes
* Bi-directional replication with conflict resolution of Detection Type=USE_PK_DATA, Resolution Type=FALLBACK, Ping Back=SINGLE_ROW
* Set Push interval for 5 seconds to speed-up testing.
* A table with column of NVARCHAR(MAX) or VARCHAR(MAX) data type, which is NOT a part of primary key.
* One more column, of a primitive data type (non-LOB) , which is also NOT a part of primary key.
* Initial value of null of blank string for the column of NVARCHAR(MAX) or VARCHAR(MAX) data type
* Two or more simultaneous and conflicting batches on opposite nodes, with an UPDATE change targeting different columns mentioned above.
Steps To ReproduceServer db=SQL Server (SymQaRoot schema)
Client db=SQL Server (SymQaClient schema)

CREATE TABLE SymQaRoot.dbo.test_nvarchar_max(
    id int NOT NULL
    ,col2 int NULL
    ,col3 nvarchar(max) NULL
    ,CONSTRAINT test_nvarchar_max_pk UNIQUE (id)
);

INSERT INTO SymQaRoot.dbo.test_nvarchar_max VALUES (1, 11, NULL); -- Seed null value for col3

-- Create two conflicting updates (on two different nodes) targeting different columns:
UPDATE SymQaRoot.dbo.test_nvarchar_max SET col2=33 WHERE id=1;
UPDATE SymQaClient.dbo.test_nvarchar_max SET col3='COMMENT_33' WHERE id=1;

-- Observe:
-- Three changes to the col3 column, resulting in:
-- (correct) col3 == COMMENT_33 in symQaRoot.dbo.test_nvarchar_max
-- (incorrect) col3 == empty/null value in the symQaClient.dbo.test_nvarchar_max
-- Note: The col2 is set to 33 on both nodes (correct).

Select 'source' as node, s.* FROM SymQaRoot.dbo.test_nvarchar_max s
UNION ALL
Select 'target' as node, t.* FROM SymQaClient.dbo.test_nvarchar_max t;
Tagsconflict manager, dialect: sql-server

Relationships

related to 0006621 closedpbelov SymmetricDS NVARCHAR(MAX) and VARCHAR(MAX) columns get modified when another column is updated (SQLServer-specific) 
related to 0006107 assignedpmarzullo SymmetricDS Restart of instance creates USE_CHANGED_DATA/NEWER_WINS batches even when conflict.default.pk.with.fallback=true 

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.15 21c49561

2024-12-11 15:57:10

pbelov


Committer: GitHub Details Diff
0006674 Check if new LOB NVARCHAR(MAX) value is not null (0000212)

0006674 Check if new LOB NVARCHAR(MAX) value is not null, while old value is null
* Pass Column object into isLob to detect NVARCHAR(MAX) column types
Affected Issues
0006674
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/mssql/MsSql2005TriggerTemplate.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/db/AbstractTriggerTemplate.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/model/Table.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/AbstractDatabasePlatform.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/IDatabasePlatform.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/cassandra/CassandraPlatform.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/kafka/KafkaPlatform.java Diff File
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/reader/ExtractDataReader.java Diff File
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/DefaultDatabaseWriter.java Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/ase/AseDatabasePlatform.java Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/derby/DerbyDatabasePlatform.java Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/informix/InformixDatabasePlatform.java Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/mssql/MsSql2000DatabasePlatform.java Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/oracle/OracleDatabasePlatform.java Diff File
mod - symmetric-sqlexplorer/src/main/java/org/jumpmind/vaadin/ui/common/ReadOnlyTextAreaDialog.java Diff File

Issue History

Date Modified Username Field Change
2024-12-11 01:43 pbelov New Issue
2024-12-11 01:43 pbelov Status new => assigned
2024-12-11 01:43 pbelov Assigned To => pbelov
2024-12-11 01:43 pbelov Tag Attached: conflict manager
2024-12-11 01:43 pbelov Tag Attached: dialect: sql-server
2024-12-11 01:43 pbelov Status assigned => confirmed
2024-12-11 02:05 pbelov Description Updated View Revisions
2024-12-11 02:05 pbelov Steps to Reproduce Updated View Revisions
2024-12-11 02:09 pbelov Description Updated View Revisions
2024-12-11 02:09 pbelov Steps to Reproduce Updated View Revisions
2024-12-11 15:59 pbelov Status confirmed => resolved
2024-12-11 15:59 pbelov Resolution open => fixed
2024-12-11 15:59 pbelov Fixed in Version => 3.15.12
2024-12-11 16:00 pbelov Changeset attached => SymmetricDS 3.15 21c49561
2024-12-11 20:34 pbelov Relationship added related to 0006621
2024-12-11 20:34 pbelov Relationship added related to 0006107