[ 
https://issues.apache.org/jira/browse/KNOX-3253?focusedWorklogId=1007030&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1007030
 ]

ASF GitHub Bot logged work on KNOX-3253:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Feb/26 07:59
            Start Date: 25/Feb/26 07:59
    Worklog Time Spent: 10m 
      Work Description: 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




Issue Time Tracking
-------------------

            Worklog Id:     (was: 1007030)
    Remaining Estimate: 0h
            Time Spent: 10m

> Improve DB table creation with locks
> ------------------------------------
>
>                 Key: KNOX-3253
>                 URL: https://issues.apache.org/jira/browse/KNOX-3253
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>    Affects Versions: 2.1.0
>            Reporter: Tamás Hanicz
>            Assignee: Tamás Hanicz
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This is an improvement on KNOX-3252 . Database table creation should be 
> improved with DB level locks to avoid exceptions due to race conditions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to