Skip to content

[Pipe] Batch OPC UA sink writes - #18384

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/opcua-batch-write-master
Open

[Pipe] Batch OPC UA sink writes#18384
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/opcua-batch-write-master

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Target master.

Cherry-pick #18380 from dev/1.3.

The OPC UA sink previously issued and awaited one writeValue RPC for every measurement in a tablet. This change collects the writes for a tablet and sends them through one writeValues request.

Missing-node recovery is preserved:

  • inspect each returned status and collect only Bad_NodeIdUnknown writes;
  • deduplicate shared nodes before calling addNodes;
  • retry only the writes whose nodes were missing;
  • continue to fail immediately on other bad statuses with measurement context.

The cherry-pick keeps the compile-time i18n messages and Tablet#setRowSize API used on master.

Unit tests cover a successful multi-measurement batch, missing-node creation and selective retry, and a non-recoverable write status.

Verification

mvn -o -nsu -pl iotdb-core/datanode \
  -Ddevelocity.off=true \
  -DskipTests \
  clean test-compile

mvn -o -nsu -pl iotdb-core/datanode \
  -Ddevelocity.off=true \
  -Dtest=IoTDBOpcUaClientTest \
  -Dsurefire.failIfNoSpecifiedTests=false \
  surefire:test

Results:

  • module main and test compilation passed;
  • 3 tests run, 0 failures, 0 errors, 0 skipped;
  • Checkstyle and Spotless passed;
  • git diff --check origin/master...HEAD passed.

Local synthetic benchmark

The local-only benchmark from #18380 compared the previous per-measurement request pattern with the batch request under a simulated 5 ms response delay:

Measurements per tablet Previous RPCs Batch RPCs Previous median Batch median Speedup
100 100 1 1547.574 ms/tablet 15.329 ms/tablet 100.96x

This is a synthetic RPC-count and latency comparison rather than a measurement of production OPC UA server throughput.


This PR has:

  • been self-reviewed.
  • added unit tests for the new batch and recovery paths.

Key changed/added classes
  • IoTDBOpcUaClient
  • IoTDBOpcUaClientTest

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