You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/04/06 13:54:53 UTC

[GitHub] [incubator-apisix] de1o opened a new issue #1404: bug: maybe apisix should look for an A record in dns query result instead of get random one

de1o opened a new issue #1404: bug: maybe apisix should look for an A record in dns query result instead of get random one
URL: https://github.com/apache/incubator-apisix/issues/1404
 
 
   ### Issue description
   now in apisix.core.utils.dns_parse method, the code choose a random one from dns query result.
   when the dns record is a CNAME record, dns query may get result like 
   ```
   [{"cname":"cname.xxx.com","class":1,"ttl":600,"name":"server.xxx.com","section":1,"type":5},
   {"address":"10.9.1.1","class":1,"ttl":600,"name":"cname.xxx.com","section":1,"type":1}]
   ```
   in this case, user expect to get the A record of domain server.xxx.com, while apisix will return random result, which may cause upstream/routes get empty nodes.
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): current master
   * OS: any
   
   ### Minimal test code / Steps to reproduce the issue
   1.config a domain in upstream, the domain's dns record set to a CNAME record.
   2.request the route configed with the domain
   
   ### What's the actual result? (including assertion message & call stack if applicable)
   request will fail randomly depend on the code in dns_parse
   
   ### What's the expected result?
   requests always work fine with CNAME record domains.
   apisix should do a loop in dns query result to find a A record, or filter all the CNAME record then find a random A record?
   

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] membphis commented on issue #1404: bug: maybe apisix should look for an A record in dns query result instead of get random one

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1404: bug: maybe apisix should look for an A record in dns query result instead of get random one
URL: https://github.com/apache/incubator-apisix/issues/1404#issuecomment-609837649
 
 
   The first one is not a good solution by default.
   
   DNS returns multiple addresses, it is to let the client choose randomly, so that it can achieve "load balancing".

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] de1o commented on issue #1404: bug: maybe apisix should look for an A record in dns query result instead of get random one

Posted by GitBox <gi...@apache.org>.
de1o commented on issue #1404: bug: maybe apisix should look for an A record in dns query result instead of get random one
URL: https://github.com/apache/incubator-apisix/issues/1404#issuecomment-609813105
 
 
   I read the current master branch code, my issue has already been solved, dns_parse do a second dns query for the CNAME domain.
   In my test case, the A record will return in the first DNS query(with the CNAME record as array), so may be do a loop find first can save a dns query?

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] membphis closed issue #1404: [discuss] maybe apisix should look for an A record in dns query result instead of get random one

Posted by GitBox <gi...@apache.org>.
membphis closed issue #1404: [discuss] maybe apisix should look for an A record in dns query result instead of get random one
URL: https://github.com/apache/incubator-apisix/issues/1404
 
 
   

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] de1o commented on issue #1404: [discuss] maybe apisix should look for an A record in dns query result instead of get random one

Posted by GitBox <gi...@apache.org>.
de1o commented on issue #1404: [discuss] maybe apisix should look for an A record in dns query result instead of get random one
URL: https://github.com/apache/incubator-apisix/issues/1404#issuecomment-609856717
 
 
   thanks, so we can still filter all A records in query result and then choose a random one(for saving another dns query?)

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] membphis commented on issue #1404: [discuss] maybe apisix should look for an A record in dns query result instead of get random one

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1404: [discuss] maybe apisix should look for an A record in dns query result instead of get random one
URL: https://github.com/apache/incubator-apisix/issues/1404#issuecomment-610102865
 
 
   yes. we can close this issue now.

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


With regards,
Apache Git Services