Advanced iRules: Tables
Hi Jason, thank you for this article on tables in iRules. I use tables in iRules to share data between virtuals. In this case I share a master key containing a service name. Just recently I discovered the tables aren't sync anymore on multi tmm instances. Perhaps you have a clue to sync tables again? Here are my logs. I add a session key into a subtable on one proxy and read it from another:
Proxy 1:
Aug 9 07:00:51 apmmuc01 info tmm7[14294]: Rule /way-software/WAY-AppAuthenticate-V2.3.01.iRule : REQ-A42-log: access to auth 483a86b149b2cfd5
Aug 9 07:00:51 apmmuc01 info tmm7[14294]: Rule /way-software/WAY-AppAuthenticate-V2.3.01.iRule : REQ-A42-tbl: master key wayservices
Proxy 2:
Aug 9 07:00:51 apmmuc01 info tmm7[14294]: Rule /way-software/WAY-Authenticate-V2.1.03.iRule : APM-E02-log: session id is 483a86b149b2cfd5
Aug 9 07:00:51 apmmuc01 info tmm7[14294]: Rule /way-software/WAY-Authenticate-V2.1.03.iRule : APM-I03-tab: master key wayservices
By chance the two iRules share the same tmm.
This is where it fails:
Proxy 1:
Aug 9 07:34:29 apmmuc01 info tmm4[14294]: Rule /way-software/WAY-AppAuthenticate-V2.3.02.iRule : REQ-A42-log: access to auth c6c405d09094e2ab
Aug 9 07:34:29 apmmuc01 info tmm4[14294]: Rule /way-software/WAY-AppAuthenticate-V2.3.02.iRule : REQ-A42-tbl: master key wayservices
Proxy 2:
Aug 9 07:34:29 apmmuc01 info tmm1[14294]: Rule /way-software/WAY-Authenticate-V2.3.02.iRule : APM-E02-log: session id is c6c405d09094e2ab
Aug 9 07:34:29 apmmuc01 info tmm1[14294]: Rule /way-software/WAY-Authenticate-V2.3.02.iRule : APM-I03-tab: master key
The two iRules run on separate tmm. I use since 11.3 (2015) reliably, but recently I see this changed behavior. Do you have an idea what is wrong? The code itself is pretty simple:
log local0. "REQ-A42-log: access to auth $JWTsessionKey"
log local0. "REQ-A42-tbl: master key [table lookup -subtable $WayMasterTable $JWTsessionKey]"
set tableKey [table lookup -subtable $WayMasterTable $sessionKey]
log local0. "APM-E02-log: session id is $sessionKey]
log local0. "APM-I03-tab: master key $tableKey"
I would be more than happy I you could help. I assume I'm not the only one to use tables to share information between proxies.
Cheers,
Cay