Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: lightning导入问题,在设置为local模式后,导入会一直报目录不为空
[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]
Could you please provide some ideas?
Do you have a screenshot of the error?
After switching the TiDB mode, what operations were performed in this step?
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.
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.
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?
Please attach the running logs of Lightning and the configuration file.
I can’t take screenshots, so I’m relying entirely on my memory.
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.
It would be best to provide the import command for better analysis.
Sorry, I still haven’t received the backend logs yet.
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.
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.
Is this issue no longer reproducible?
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.
Next time when you can operate, mainly check the configuration. This should be a minor issue in the details.
Okay, next time let’s see if it might be a configuration issue.
Did a certain import stop without using a command to clear it?