[ 
https://issues.apache.org/jira/browse/PHOENIX-6072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17175898#comment-17175898
 ] 

Chinmay Kulkarni commented on PHOENIX-6072:
-------------------------------------------

* Note that this was not a problem in 4.14.x since we created the SYSTEM.MUTEX 
table via 
CQSI.[createSysMutexTableIfNotExists|https://github.com/apache/phoenix/blob/e2993552dc88cb7fc59fc0dfdaa2876ac260886c/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L2733].

* This is an issue in 4.15+ probably because the create DDL does not have a TTL 
in it, and the 
CQSI.[createSysMutexTableIfNotExists|https://github.com/apache/phoenix/blob/a99db61cd82ae2b83add2a1bd74fd80baa5c91c7/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L3270]
 call which does add a TTL_FOR_MUTEX via columnDesc.setTimeToLive(), only gets 
triggered in the upgrade code path and if the table already exists, we [return 
early|https://github.com/apache/phoenix/blob/a99db61cd82ae2b83add2a1bd74fd80baa5c91c7/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L3260]
 without modifying the TTL.

* The change should be probably to add TTL to the DDL statement itself (will 
help for fresh clusters) and for clusters where SYSTEM.MUTEX already exists, we 
will have to modify the TTL if it is not set/set to FOREVER.
FYI [~yanxinyi] [~jisaac] [~tdsilva]

> SYSTEM.MUTEX not created with a TTL on a fresh cluster connected to by a 
> 4.15+ client
> -------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6072
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6072
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.15.0
>            Reporter: Chinmay Kulkarni
>            Priority: Blocker
>             Fix For: 5.1.0, 4.16.0
>
>
> If you have a fresh cluster that is directly connected to via a 4.15+ client, 
> then SYSTEM.MUTEX gets created without a TTL (See 
> [this|https://github.com/apache/phoenix/blob/a99db61cd82ae2b83add2a1bd74fd80baa5c91c7/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java#L3335])
>  The SYSTEM.MUTEX 
> [DDL|https://github.com/apache/phoenix/blob/a99db61cd82ae2b83add2a1bd74fd80baa5c91c7/phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java#L367-L379]
>  does not specify a TTL.
> This will obviously be a problem when a client does any operation that 
> requires writing a cell to SYSTEM.MUTEX via checkAndPut (like add/drop 
> column, create view, etc.) and dies/gets disconnected before being able to 
> delete the mutex cell. 
> After that point, since the cell will stay written and never be TTL’ed, any 
> operation which requires a checkAndPut on that cell will always fail with a 
> ConcurrentTableMutationException, deeming any further add/drop cols or create 
> view for the same name impossible.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to