virtual command and reselecting
Hi,
I tried to figure it out but it is to complicated considering my knowledge of iRules.
Scenario:
- VS that based on URI is directing traffic to different VSs using virtual command
- If there is no path specified (just "/") traffic should not be directed to other VS but processed by switching VS
- Everything is OK when first connection without any path is performed - traffic processed by switching VS
- When connection using given path is performed like /compress it's correctly directed to other VS
- Then when another connection (with cache and cookies cleared in browser) is again not using any path (just "/") it's not processed by switching VS but directed to previously selected VS
I am pretty sure it has something to do with info from virtual command description "In order to make this functionality work, one must precede the virtual command with an LB::reselect command if a pool member has already been selected". Problem is that I don't know how to use it or if this is indeed correct command to use.
Especially that only events LB:reselect can be used are LB_SELECTED, LB_QUEUED, PERSIST_DOWN, LB_FAILED.
When using [LB::select] in SERVER_CONNECTED log message I can see that before virtual is used pool name is logged (is pool /Common/pool member IP:PORT), after virtual is used then log entry is listing ip of target VS to which virtual command switched traffic (node IP:PORT - where this is ip and port of VS, called here node for some reason).
Then subsequent connections without path specified (new http sessions as cookies and cache is cleared, no persistence used on switching VS) are all directed to this "node", there is even no SERVER_CONNECTED event fired.
Data used to switch VSs (or stay on switching VS) is retrieved from URI (so in HTTP_REQUEST), I am not sure in which events related to this variables from HTTP_REQUEST event could be used and most important how to reset VS selections so for "/" connection is again processed by switching VS.
Piotr