Forum Discussion

jwight1464's avatar
jwight1464
Icon for Nimbostratus rankNimbostratus
May 15, 2012

TCP Universal Persistence not saving

We are currently working on a MS SQL server persistence iRule that will read the TCP::payload for a certain SQL parameter that we are passing and save the value in the uie table for persistence lookups. The current version running on our virtual LTM is 11.1 HF2. The issue we are having is that we are unable to get the persist uie working reliably from the when client_data event. When we are working with the simple sample below it is hit or miss if the entry saves to the table. A secondary issue we have run into is that the table only appears to want to save numeric values up to 5 digits. Anyone have any ideas?

 

Works intermittently

 

when CLIENT_ACCEPTED {

 

TCP::collect 25

 

}

 

when CLIENT_DATA {

 

 

set rfk 12345

 

log local0. "static value = $rfk"

 

persist uie $rfk

 

set pv [persist lookup uie $rfk]

 

log local0. "pv = $pv"

 

 

TCP::release

 

TCP::collect

 

}

 

 

 

Does not Work at all

 

when CLIENT_ACCEPTED {

 

TCP::collect 25

 

}

 

when CLIENT_DATA {

 

 

set rfk abcde

 

log local0. "static value = $rfk"

 

persist uie $rfk

 

set pv [persist lookup uie $rfk]

 

log local0. "pv = $pv"

 

 

TCP::release

 

TCP::collect

 

}

 

Works intermittently

 

when CLIENT_ACCEPTED {

 

TCP::collect 25

 

}

 

when CLIENT_DATA {

 

 

set rfk 12345

 

log local0. "static value = $rfk"

 

persist uie $rfk

 

set pv [persist lookup uie $rfk]

 

log local0. "pv = $pv"

 

 

TCP::release

 

TCP::collect

 

}

 

 

Does not Work at all

 

when CLIENT_ACCEPTED {

 

TCP::collect 25

 

}

 

when CLIENT_DATA {

 

 

set rfk abcde

 

log local0. "static value = $rfk"

 

persist uie $rfk

 

set pv [persist lookup uie $rfk]

 

log local0. "pv = $pv"

 

 

TCP::release

 

TCP::collect

 

}

 

 

  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account
    I think part of the problem here is you are setting a persist entry before the LTM has made a LB choice. The LTM is accepting the connection and doing a data collect on the third packet, it is then using the data from the third packet to make the persist setting but at this time there is no selected pool member for the persist to happen on. The next client data though should have a connection built and when the persist command is run you should get a result back.

     

     

    if you look through the MySql Proxy iRule

     

    https://devcentral.f5.com/wiki/iRules.MySQL-Proxy.ashx

     

     

    You can see the persist statement is not called till the session has been auth.

     

     

    A way around what you are doing would be to peform the persist in LB_SELECTED and set persistence there.

     

     

    Again I could be wrong but with the info I see, I think this is a good starting point to look at the problem. Thanks