You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
receive: Extract lostFoundDir constant and add rationale comment
Per reviewer feedback, replace the "lost+found" string literal with a
named constant and document why the directory is skipped and why a
name-based check was chosen over inode or filesystem-type inspection.
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
// lostFoundDir is the directory name that ext4 (and some other filesystems)
407
+
// create automatically at the root of every partition. When a receiver's
408
+
// --tsdb.path points directly at a mount point, the directory scan in Open()
409
+
// and RemoveLockFilesIfAny() would otherwise treat it as a tenant name and
410
+
// attempt to open or clean a TSDB for it, producing spurious errors on
411
+
// startup. A name-based skip is the simplest cross-platform fix; checking the
412
+
// inode or filesystem type would require platform-specific syscalls and adds
413
+
// complexity without meaningful safety benefit, since a tenant legitimately
414
+
// named "lost+found" is not a realistic concern.
415
+
constlostFoundDir="lost+found"
416
+
406
417
// generateCompactionDelay() generates a time.Duration of up to compactionDelayPercentBlockLength% of the block range. Used to stagger compactions & uploads.
0 commit comments