You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wankai123 (via GitHub)" <gi...@apache.org> on 2025/09/22 10:11:08 UTC
[PR] BanyanDB: fix log query missing order by condition, and fix missing service id condition when query by instance id or endpoint id. [skywalking]
wankai123 opened a new pull request, #13508:
URL: https://github.com/apache/skywalking/pull/13508
- [ ] 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).
--
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: fix log query missing order by condition, and fix missing service id condition when query by instance id or endpoint id. [skywalking]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #13508:
URL: https://github.com/apache/skywalking/pull/13508#discussion_r2367599835
##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/stream/BanyanDBLogQueryDAO.java:
##########
@@ -76,9 +77,14 @@ public void apply(StreamQuery query) {
}
if (StringUtil.isNotEmpty(serviceInstanceId)) {
+ IDManager.ServiceInstanceID.InstanceIDDefinition instanceIDDefinition = IDManager.ServiceInstanceID.analysisId(
+ serviceInstanceId);
Review Comment:
We could only set service by instance ID decode when service id absent.
##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/stream/BanyanDBLogQueryDAO.java:
##########
@@ -76,9 +77,14 @@ public void apply(StreamQuery query) {
}
if (StringUtil.isNotEmpty(serviceInstanceId)) {
+ IDManager.ServiceInstanceID.InstanceIDDefinition instanceIDDefinition = IDManager.ServiceInstanceID.analysisId(
+ serviceInstanceId);
Review Comment:
Because this setting could override wrong service ID, returning logs in that case is a bug.
--
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: fix log query missing order by condition, and fix missing service id condition when query by instance id or endpoint id. [skywalking]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13508:
URL: https://github.com/apache/skywalking/pull/13508#discussion_r2367429124
##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/stream/BanyanDBLogQueryDAO.java:
##########
@@ -100,6 +106,13 @@ public void apply(StreamQuery query) {
}
query.and(having(LogRecord.TAGS, tagsConditions));
}
+ if (queryOrder == Order.ASC) {
+ query.setOrderBy(
+ new AbstractQuery.OrderBy(AbstractQuery.Sort.ASC));
+ } else {
Review Comment:
The order by logic assumes that any non-ASC order should be DESC, but doesn't handle null or other potential Order values. Consider adding explicit null checking or handling for unexpected Order values to make the logic more robust.
```suggestion
if (queryOrder == null) {
// Default to DESC if queryOrder is null
query.setOrderBy(
new AbstractQuery.OrderBy(AbstractQuery.Sort.DESC));
} else if (queryOrder == Order.ASC) {
query.setOrderBy(
new AbstractQuery.OrderBy(AbstractQuery.Sort.ASC));
} else if (queryOrder == Order.DESC) {
query.setOrderBy(
new AbstractQuery.OrderBy(AbstractQuery.Sort.DESC));
} else {
// Unexpected value, default to DESC and optionally log a warning
```
--
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: fix log query missing order by condition, and fix missing service id condition when query by instance id or endpoint id. [skywalking]
Posted by "wankai123 (via GitHub)" <gi...@apache.org>.
wankai123 commented on code in PR #13508:
URL: https://github.com/apache/skywalking/pull/13508#discussion_r2367448769
##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/stream/BanyanDBLogQueryDAO.java:
##########
@@ -100,6 +106,13 @@ public void apply(StreamQuery query) {
}
query.and(having(LogRecord.TAGS, tagsConditions));
}
+ if (queryOrder == Order.ASC) {
+ query.setOrderBy(
+ new AbstractQuery.OrderBy(AbstractQuery.Sort.ASC));
+ } else {
Review Comment:
null != Order.ASC)
##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/stream/BanyanDBLogQueryDAO.java:
##########
@@ -100,6 +106,13 @@ public void apply(StreamQuery query) {
}
query.and(having(LogRecord.TAGS, tagsConditions));
}
+ if (queryOrder == Order.ASC) {
+ query.setOrderBy(
+ new AbstractQuery.OrderBy(AbstractQuery.Sort.ASC));
+ } else {
Review Comment:
null != Order.ASC
--
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: fix log query missing order by condition, and fix missing service id condition when query by instance id or endpoint id. [skywalking]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #13508:
URL: https://github.com/apache/skywalking/pull/13508
--
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