alpass163 opened a new pull request, #19041:
URL: https://github.com/apache/iotdb/pull/19041

   Two template bugs also exist on dev/1.3:
   
     1. `BatchActivateTemplateStatement.getPaths()` and 
`InternalBatchActivateTemplateStatement.getPaths()` collect the
     measurements of all matched templates into a single list and then 
concatenate them with every device path. A device
     resolved to one template is therefore checked with other templates' 
measurements, and devices without a template still
     contribute paths.
     2. `ClusterTemplateManager.checkTemplateSetInfo()` uses the bidirectional 
`startsWithOrPrefixOf()`, so an ancestor
     device (e.g. `root.sg`) matches a template mounted on a descendant (e.g. 
`root.sg.v1`).
   
     ## Fix
   
     - Build the paths of each device from the measurements of the template 
resolved for that device.
     - Add `PartialPath.startsWithOrEqual()` and use it in 
`checkTemplateSetInfo()`, so that only the mount path itself or
     its descendants match. `checkTemplateSetAndPreSetInfo()` keeps the 
bidirectional check, since an ancestor is still a
     conflict when creating a measurement.
     - Add unit tests covering both cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to