You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2025/01/04 15:37:53 UTC

[PR] BanyanDB: Add installation check for `storageOnly = true` columns. [skywalking]

wu-sheng opened a new pull request, #12928:
URL: https://github.com/apache/skywalking/pull/12928

   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
   
   * BanyanDB: Add installation check for `storageOnly = true` columns. All columns should be `@BanyanDB.MeasureField` or
     in the index mode entity. Tags are for indexing columns and series IDs only.
   * Remove `@BanyanDB.IndexMode` from TopN implementation, as it's not necessary. Those are records, not metrics.
   * Fix, move `Service`, `Instance`, `Endpoint` and `Process` relations out of `index-mode`, as they are time series.
   
   @hanahmily @wankai123 I was trying to make all `storageOnly = true` columns in measure as fields automatically without extra/explict annotation, but I noticed the value-column still needs that explicit annotation. So, I still keep it. WDYT?


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BanyanDB: Add installation check for `storageOnly = true` columns. [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #12928:
URL: https://github.com/apache/skywalking/pull/12928#issuecomment-2571454923

   Closing this PR, we can't do this.
   
   In the topology query, `componentIds` are a part of `group by`, so, it has to be a tag. Meanwhile it is a filter condition, so, it doesn't need to be indexing.


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BanyanDB: Add installation check for `storageOnly = true` columns. [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #12928:
URL: https://github.com/apache/skywalking/pull/12928#discussion_r1903116534


##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/MetadataRegistry.java:
##########
@@ -164,6 +178,20 @@ public MeasureModel registerMeasureModel(Model model, BanyanDBStorageConfig conf
             if (!tagsAndFields.fields.isEmpty()) {
                 throw new StorageException("index mode is enabled, but fields are defined");
             }
+        } else {
+            List<String> storageOnlyTags
+                = tagsAndFields.tags.stream()
+                                    // filter out index tags
+                                    .filter(tagMetadata -> !tagMetadata.isIndex())
+                                    // filter out seriesID tags
+                                    .filter(tagMetadata -> !seriesIDColumns.contains(tagMetadata.getTagSpec().getName()))
+                                    .map(tagMetadata -> tagMetadata.getTagSpec().getName())
+                                    .collect(Collectors.toList());
+            if (!storageOnlyTags.isEmpty()) {
+                throw new StorageException(model.getName() + ":"
+                                               + "storage only tags(" + storageOnlyTags + ") are not recommended in measure model, "
+                                               + "please change the entity to index mode or use field(@BanyanDB.MeasureField) instead");
+            }

Review Comment:
   This part is the new logic. If there are storage-only tags exist in the installation stage, an exception will be thrown out.



-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BanyanDB: Add installation check for `storageOnly = true` columns. [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed pull request #12928: BanyanDB: Add installation check for `storageOnly = true` columns.
URL: https://github.com/apache/skywalking/pull/12928


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org