hanahmily commented on code in PR #239:
URL:
https://github.com/apache/skywalking-banyandb/pull/239#discussion_r1083372899
##########
banyand/liaison/grpc/registry.go:
##########
@@ -435,7 +437,37 @@ type topNAggregationRegistryServer struct {
func (ts *topNAggregationRegistryServer) Create(ctx context.Context,
req *databasev1.TopNAggregationRegistryServiceCreateRequest,
) (*databasev1.TopNAggregationRegistryServiceCreateResponse, error) {
- if err :=
ts.schemaRegistry.TopNAggregationRegistry().CreateTopNAggregation(ctx,
req.GetTopNAggregation()); err != nil {
+ topNSchema := req.GetTopNAggregation()
Review Comment:
Placing the creation in the loading phase ensures the measure always exists.
Restarting the server will create the target measure if it's missing. As I
mentioned, banyandb doesn't support transactional operations. Creating more
than one resource in a task is too dangerous.
There are two options here:
1. Move `processorManager.start` to the `Serve` phase. That means you should
iterate all measures to start their embedded `processorManager`
2. Introduce Etcd's transactional operation. You could leverage a
transaction to create topN resource and its derived measure by moving the
creation operation to the `metadata` module instead of `liaison`.
--
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]