[
https://issues.apache.org/jira/browse/KNOX-3536?focusedWorklogId=1051306&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1051306
]
ASF GitHub Bot logged work on KNOX-3536:
----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Oct/26 21:46
Start Date: 29/Oct/26 21:46
Worklog Time Spent: 10m
Work Description: hanicz merged PR #1477:
URL: https://github.com/apache/knox/pull/1477
Issue Time Tracking
-------------------
Worklog Id: (was: 1051306)
Time Spent: 20m (was: 10m)
> JDBCTokenStateService fails on PostgreSQL in HA: duplicate key on
> pg_type_typname_nsp_index during concurrent table creation
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: KNOX-3536
> URL: https://issues.apache.org/jira/browse/KNOX-3536
> Project: Apache Knox
> Issue Type: Bug
> Components: Server
> Affects Versions: 3.0.0
> Reporter: Tamás Hanicz
> Assignee: Tamás Hanicz
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When several Knox instances start at the same time against an empty
> PostgreSQL database, \{{JDBCTokenStateService}} can fail to initialize:
> {noformat}
> PSQLException: ERROR: duplicate key value violates unique constraint
> "pg_type_typname_nsp_index"
> Detail: Key (typname, typnamespace)=(knox_tokens, 2200) already exists.
> {noformat}
> Cause: The Postgres DDL scripts wrap \{{CREATE TABLE IF NOT EXISTS}} in
> \{{pg_advisory_lock}} / \{{pg_advisory_unlock}}. The whole script is sent in
> one \{{Statement.execute()}}, which PostgreSQL runs as a single implicit
> transaction. As a result, the unlock happens before the \{{CREATE TABLE}}
> commits, and the next instance creates the table again.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)