You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/10/10 06:38:32 UTC

[GitHub] chetanmeh edited a comment on issue #4061: Ensure CosmosDBArtifactStore return query results within limits

chetanmeh edited a comment on issue #4061: Ensure CosmosDBArtifactStore return query results within limits
URL: https://github.com/apache/incubator-openwhisk/pull/4061#issuecomment-428455143
 
 
   > if multiple records are returned, is it guaranteed to be safe to choose the first one? 
   
   Per docs it appears to be 
   
   https://github.com/apache/incubator-openwhisk/blob/57a38de7a6b23bc4c42f7e777a4cb2da477a355f/common/scala/src/main/scala/whisk/core/entity/Identity.scala#L62-L67
   
   Looking at flow for `Identity#get(AuthStore, EntityName)` it appears to be used 
   
   https://github.com/apache/incubator-openwhisk/blob/57a38de7a6b23bc4c42f7e777a4cb2da477a355f/core/controller/src/main/scala/whisk/core/controller/RestAPIs.scala#L339-L351
   
   So one namespace can have multiple keys. Now CosmosDB 
   
   https://github.com/apache/incubator-openwhisk/blob/57a38de7a6b23bc4c42f7e777a4cb2da477a355f/common/scala/src/main/scala/whisk/core/database/DocumentHandler.scala#L432-L456
   
   would ensure that it picks up the right set of naemsapce from all the namespaces found in the subject. So in current case the 2 returned docs would be same subject and view compute logic would find out the matching namespace entry. Thus returning `team1` only.
   
   I have improved the new testcase to also check above case i.e. all returned result have the passed namespace

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services