You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/12/28 02:45:48 UTC

[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #168: #79 消息轨迹推送跟踪

tianxiaoliang commented on a change in pull request #168:
URL: https://github.com/apache/servicecomb-kie/pull/168#discussion_r549196019



##########
File path: server/service/mongo/track/polling_detail_dao.go
##########
@@ -29,9 +29,10 @@ import (
 )
 
 //CreateOrUpdate create a record or update exist record
+//If revision and session_id is exist: update else:insert
 func CreateOrUpdate(ctx context.Context, detail *model.PollingDetail) (*model.PollingDetail, error) {
 	collection := session.GetDB().Collection(session.CollectionPollingDetail)
-	queryFilter := bson.M{"domain": detail.Domain, "session_id": detail.SessionID}
+	queryFilter := bson.M{"revision": detail.Domain, "session_id": detail.SessionID}

Review comment:
       revision不可能和domain产生关系

##########
File path: deployments/db.js
##########
@@ -114,15 +114,14 @@ db.createCollection( "polling_detail", {
 } );
 
 //index
-db.kv.createIndex({"id": 1}, { unique: true } );
-db.kv.createIndex({key: 1, label_format: 1,domain:1,project:1},{ unique: true });
-db.kv_revision.createIndex( { "delete_time": 1 }, { expireAfterSeconds: 7 * 24 * 3600 } );
-db.label.createIndex({"id": 1}, { unique: true } );
-db.label.createIndex({format: 1,domain:1,project:1},{ unique: true });
-db.polling_detail.createIndex({"id": 1}, { unique: true } );
-db.polling_detail.createIndex({session_id:1,domain:1}, { unique: true } );
-db.counter.createIndex({name: 1,domain:1},{ unique: true });
-db.view.createIndex({"id": 1}, { unique: true } );
-db.view.createIndex({display:1,domain:1,project:1},{ unique: true });
+db.kv.createIndex({"id": 1}, {unique: true});
+db.kv.createIndex({key: 1, label_format: 1, domain: 1, project: 1}, {unique: true});
+db.kv_revision.createIndex({"delete_time": 1}, {expireAfterSeconds: 7 * 24 * 3600});
+db.label.createIndex({"id": 1}, {unique: true});
+db.label.createIndex({format: 1, domain: 1, project: 1}, {unique: true});
+db.polling_detail.createIndex({timestamp: 1}, {expireAfterSeconds: 7 * 24 * 3600});

Review comment:
       需要再做个唯一约束,revision+sessionid+domain




----------------------------------------------------------------
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.

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