Issue with Lightning Import: Directory Not Empty Error Persists in Local Mode

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: lightning导入问题,在设置为local模式后,导入会一直报目录不为空

| username: 气死人的萌新

[TiDB Usage Environment] Testing
[TiDB Version] v6.5.0
[Reproduction Path] Configured in local mode, performing import operation
[Encountered Problem: The import keeps reporting that the directory is not empty, but I can’t get the backend logs, nor do I have error screenshots, so I’m asking if anyone has any ideas. I have tried deleting the directory and re-importing, but the error persists. After switching to TiDB mode, the import works normally.]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: 气死人的萌新 | Original post link

Could you please provide some ideas?

| username: zhanggame1 | Original post link

Do you have a screenshot of the error?

| username: redgame | Original post link

After switching the TiDB mode, what operations were performed in this step?

| username: 气死人的萌新 | Original post link

There is none.

| username: 气死人的萌新 | Original post link

Normally, importing around 500,000 records, but it is estimated that the machine’s I/O is not good, so it takes longer than the TiDB mode.

| username: 气死人的萌新 | Original post link

After importing, an error indicating that the directory is not empty is reported. Following the given prompt, I cleaned up and deleted the directory generated by the import. However, when I re-import, the error indicating that the directory is not empty still occurs.

| username: ffeenn | Original post link

How did you operate it? Can you provide a screenshot? Also, how did you get the “directory not empty” error you mentioned? Could you also provide a screenshot of that to better assist you?

| username: hey-hoho | Original post link

Please attach the running logs of Lightning and the configuration file.

| username: 气死人的萌新 | Original post link

I can’t take screenshots, so I’m relying entirely on my memory.

| username: ffeenn | Original post link

The physical import mode (local) encodes the data into key-value pairs and stores them sorted in a local temporary directory (sorted-kv-dir). You should specify an empty directory that is not on the same disk as the backup data. The “not empty” you mentioned should refer to this directory.

| username: zhanggame1 | Original post link

It would be best to provide the import command for better analysis.

| username: 气死人的萌新 | Original post link

Sorry, I still haven’t received the backend logs yet.

| username: 像风一样的男子 | Original post link

The sorted-kv-dir is the temporary storage location for key-value pairs. The target path needs to be an empty directory, please check this.

| username: 气死人的萌新 | Original post link

The sorted-kv-dir directory was checked and cleaned at that time, and it should have been an empty directory. However, when re-importing, it still reported that the directory was not empty. Currently, there is confusion because we don’t have permission to access the backend data, so we can’t analyze it for now. They have also switched to TiDB mode over there, so we are not dwelling on this issue.

| username: ffeenn | Original post link

Is this issue no longer reproducible?

| username: 气死人的萌新 | Original post link

It should be. I haven’t encountered the environment now, and I haven’t asked about it in the past few days. I can only see if it will be asked again later.

| username: ffeenn | Original post link

Next time when you can operate, mainly check the configuration. This should be a minor issue in the details.

| username: 气死人的萌新 | Original post link

Okay, next time let’s see if it might be a configuration issue.

| username: db_user | Original post link

Did a certain import stop without using a command to clear it?