lightning: refine the error message of lightning `DiskQuota` precheck
Enhancement
Currently, during the precheck phase, if the disk capacity is less than disk quota, precheck will failed. But the error message is a bit misleading:
+----+------------------------------------------------------------------------------------------------------------------------------------+-------------+--------+
| 6 | local disk space may not enough to finish import, estimate sorted data size is XXX, but local available is XXX, please s | critical | false |
| | et `tikv-importer.disk-quota` to a smaller value than XXX or change `mydumper.sorted-kv-dir` to another disk with enough spac | | |
| | e to finish imports | | | | | |
+----+------------------------------------------------------------------------------------------------------------------------------------+-------------+--------+
This check has nothing to do with estimated sorted size, but it's outputed at the beginning of the error message. If users don't read the error message carefully, they may misunderstand it.
https://github.com/pingcap/tidb/blob/0d8e2bb4c57ecfaaee14a42a693f9e41f34cda34/lightning/pkg/importer/precheck_impl.go#L591-L598
/cc @alastori @OliverS929
Please include "Lightning: xxx" in issue title please. Thanks!
Hey, I'd like to take this on, can someone assign it to me.
Hey, I'd like to take this on, can someone assign it to me.
Hi, the fix itself is simple, but I thinks we need to discuss with PM about the output.
@joechenrh Got it, thanks! I’ve already made the proposed changes locally — updated the error message for clarity, and also added a warning log in case tikv-importer.disk-quota is set to 0 or a negative value (which could cause misleading results). Happy to wait for the PM’s input before opening a PR.
Hi @abrarr21, @alastori is our PM on migration tools and we would need him to help us define user-related behavior and error messages.
Hi @abrarr21,
Thank you for your initiative on this and for patiently waiting for feedback. I agree with your proposed changes.
Here is my suggestion for the new error message:
"Local disk space is insufficient to meet the configured disk-quota. Available space: [actual available space], Configured disk-quota: [configured quota value]. Please increase the available disk space or adjust the tikv-importer.disk-quota setting to a value lower than the available space and try again."
Regarding the warning for when tikv-importer.disk-quota is set to 0 or a negative value, I think that's a great idea. Please include that in the pull request, and we can review the specific implementation and wording there.
We appreciate your contribution! Please proceed with creating the PR when you are ready.
@joechenrh @OliverS929 Review the changes and provide the feedback!