Too many tgs_req from jdbc (for kerberos) #15456
Replies: 3 comments 7 replies
-
Each worker needs to authenticate to Kerberos so it's entirely possible for there to be at-least as many requests to TGS as number of workers participating in query. |
Beta Was this translation helpful? Give feedback.
-
Hi, Is it my configuration that is wrong or the current situation? |
Beta Was this translation helpful? Give feedback.
-
This is classic problem with all Java apps. The reason is wrong application architecture. JDK for Java has 2 auth modules: 1) krb5LoginModule (jaas) and 2) Sun GSSAPI Native. I have no idea why developers advertise jaas that supports a short part of MIT Kerberos but full support is Native module only because it uses OS (win, unix/linux, macos, solaris, etc) krb5 libraries. MIT Kerberos KDC (Active Directory or FreeIPA project) provide SSO by credentical cache. In spite of comments about TGS many of developers don't know difference between TGT and TGS therefore they copypaste they have found on Oracle website. However no one read Oracle arcticle about Native module. You know this oldest module changes Java auth mechanism to C/C++ application behavior that uses system krb5 from the box. The only way you should get TGT by kinit and automatically store to ccache, when you connect any service (SPN) you get TGS is stored to ccache too. You can read MSLSA cache in Windows every time you try to open spnego website or to send email. As fact in user session (process owner) any your application instance or application thread re-use ccache for a long time (for example 24h by default). Of course if you have specific infrastructure where you cannot save a keytab on file system you can use renewal Kerberos extension for TGT. This feature help you to move lifetime for the next 24h once without keytab. Unfotunately developers create many of isolated contexts (because jaas doesn't support MIT TGS format and there is no way to store) for an incoming user so you can see infinite tickets on KDC side. You can compare it such as many of user relogins to Windows Desktop that is redundant of course and stupidly. Accoding trino server it requires a refactoring to use Native else TGS-flood will fail your KDC sooner or later. Btw trino jdbc for Windows (client app) should be refactored too because it doesn't support MSLSA Windows cache but it is impossible to define file ticket cache without kinit or MIT Kerberos for Windows. S4U extension How it must work but really doesn't:
|
Beta Was this translation helpful? Give feedback.
-
Hi !
my trino version is 355.
I found about five tgs_req from jdbc per second in one query.
Thank you very much for the answer!
Beta Was this translation helpful? Give feedback.
All reactions