Skip to content

Fix duplicate table device attribute updates in multi-row insert#18176

Open
Caideyipi wants to merge 1 commit into
masterfrom
fix/table-delete-attribute-no-tag
Open

Fix duplicate table device attribute updates in multi-row insert#18176
Caideyipi wants to merge 1 commit into
masterfrom
fix/table-delete-attribute-no-tag

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Coalesce duplicate table devices in one multi-row INSERT before schema validation.
  • For each (database, table, deviceId), keep the last effective non-null attribute value per attribute; missing attributes and inserted null remain no-ops.
  • Add coverage for no-tag table attribute-filtered deletion and the cache-hit duplicate-device update path.

Root cause

A no-tag table is still an exact device match: its device id is the table plus an empty tag tuple. The real issue was that InsertRows validated repeated rows for the same device one by one, so multiple attribute updates in a single statement could be affected by validation/cache ordering instead of the final row state.

Tests

  • mvn spotless:apply -pl iotdb-core/datanode,integration-test -P with-integration-tests
  • mvn --% -o -Ddevelocity.off=true -pl iotdb-core/datanode -Dtest=TableDeviceSchemaValidatorTest test
  • mvn --% -o -Ddevelocity.off=true install -DskipTests -pl iotdb-core/datanode -am
  • mvn --% -o -Ddevelocity.off=true verify -DskipUTs -Dit.test=IoTDBDeletionTableIT#testDeleteDataByAttributeFilterWithoutTagColumns -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false -pl integration-test -PTableClusterIT -P with-integration-tests

@Caideyipi Caideyipi force-pushed the fix/table-delete-attribute-no-tag branch from cd3eef5 to 0fa5dd0 Compare July 9, 2026 11:18
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@Caideyipi Caideyipi changed the title Fix no-tag table attribute deletion Fix duplicate table device attribute updates in multi-row insert Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant