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

Guoliang Sun commented on KYLIN-6040:
-------------------------------------

h3. Dev Design

Currently, after the first execution completes, `hasChecked` is set to `true`. 
If an exception is thrown, `isLogicalViewConfigLegal` is set to `false`.  
Once the issue is resolved, since `hasChecked` remains `true`, `listDatabases` 
will not be executed again. Additionally, because `isLogicalViewConfigLegal` is 
`false`, the error `DDL_CHECK_ERROR` will be thrown.  

To address this, modify the logic as follows:  
- Remove the use of `hasChecked` and `isLogicalViewConfigLegal`.  
- Always execute `listDatabases` during each invocation of 
`LogicalViewLoader.checkConfigIfNeed`.  
h3. Impact:

- `listDatabases` will now be executed every time 
`LogicalViewLoader.checkConfigIfNeed` is invoked.  

Scenarios where `LogicalViewLoader.checkConfigIfNeed` is executed:
1. Scheduled tasks:
   - Executes every `kylin.source.ddl.logical-view-catchup-interval` seconds 
(default value is 60 seconds) to sync views from the database via 
`syncViewFromDB`. This is triggered after creating, modifying, or deleting a 
logical view, which in turn triggers `syncViewAsync`.  
2. API endpoints:
   - `/api/spark_source/ddl/description`  
   - `/api/spark_source/ddl`

> Logical view fails permanently after a single failure during the scheduled 
> check.
> ---------------------------------------------------------------------------------
>
>                 Key: KYLIN-6040
>                 URL: https://issues.apache.org/jira/browse/KYLIN-6040
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Guoliang Sun
>            Priority: Major
>
> - The job node was started while the Hive cluster was restarting, causing an 
> error during the synchronization of `localview`.  
> - After a single error, in `LogicalViewLoader.checkConfigIfNeed`, the 
> `hasChecked` flag is set to `true`, and `isLogicalViewConfigLegal` is set to 
> `false`. As a result, every subsequent synchronization directly throws an 
> error when reaching `checkConfigIfNeed`. 
> - Impact: Even after the Hive cluster recovers, the synchronization of 
> `localview` continues to fail.  
> - Scope of impact: Synchronization of `localview` and creation of `localview`.



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

Reply via email to