hanicz opened a new pull request, #1157: URL: https://github.com/apache/knox/pull/1157
…catalog race condition when multiple Knox instance start up simultaneously [KNOX-3253](https://issues.apache.org/jira/browse/KNOX-3253) - Improve Postgres DB table creation with locks ## What changes were proposed in this pull request? - Adds advisory lock to the postgres table creation to avoid catalog race condition when multiple Knox instance start up simultaneously ## How was this patch tested? Manually tested with a local setup. I had postgres running in docker desktop and a local Knox instance. I created an advisory lock and created the table manually. Knox process was waiting on the lock. After unlocking it Knox proceeded with the knox_token_metadata table creation. Verified token creation on UI and DB as well. ``` <property> <name>gateway.service.tokenstate.impl</name> <value>org.apache.knox.gateway.services.token.impl.JDBCTokenStateService</value> </property> <property> <name>gateway.database.type</name> <value>postgresql</value> </property> <property> <name>gateway.database.port</name> <value>5432</value> </property> <property> <name>gateway.database.host</name> <value>localhost</value> </property> <property> <name>gateway.database.name</name> <value>mydb</value> </property> ``` ## Integration Tests N/A ## UI changes N/A -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
