0

I'm encountering an issue where I cannot properly delete a database because some chunks are in "recovering" state.

Environment:

  • DolphinDB Version: 3.00.2.4, Single mode
  • OS: Centos 7.7

What I Tried:

I attempted to delete partitions using the following code:

dbName="/stock" fileCond=dbName + "%" t=exec substr(file,strlen(dbName)) from rpc(getControllerAlias(),getClusterChunksStatus) where file like fileCond, state != "COMPLETE" dropPartition(database("dfs:/"+dbName),t,,true) 

Error Received:

tableName must be specified if the chunk granularity of the database is TABLE.

The Problem:

The node data has already been deleted, and no tables are displayed under the "stock" database in the interface. However, I'm still unable to clean up the partitions completely.

My Question:

Since there are no visible tables remaining, how should I specify the tableName parameter to successfully delete these partitions? What would be the correct approach to resolve this "recovering" chunk state and complete the database deletion in DolphinDB?

1 Answer 1

0

The practice of physically deleting files is not recommended as it may cause metadata consistency issues. Try the following steps:

  • 1.First attempt to retrieve table names:

    getTables(database("dfs://stock"))

Then execute under the ops namespace:

use ops dropRecoveringPartitions(dbPath, tableName="xxx") # Replace xxx with actual table names 

Delete tables sequentially under the database, and finally remove the database using:

dropDatabase("dfs://stock") 
  • 2.If table names cannot be obtained, use the dropPartition function:

    dropPartition(dbHandle=database("dfs://stock"), partitionPaths=xxx, forceDelete=true)

The partitionPaths can be obtained via:

schema(database("dfs://stock")) 
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.