Skip to content

manager: ListWALs: remove redundant sort, and skip directories - #3275

Open
thaJeztah wants to merge 1 commit into
moby:masterfrom
thaJeztah:rm_sort
Open

manager: ListWALs: remove redundant sort, and skip directories#3275
thaJeztah wants to merge 1 commit into
moby:masterfrom
thaJeztah:rm_sort

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

os.ReadDir already returns a sorted list;

// ReadDir reads the named directory,
// returning all its directory entries sorted by filename.

Remove the manual sort, and while updating, also skip directories, because we're looking for files.

- What I did

- How I did it

- How to test it

- Description for the changelog

os.ReadDir already returns a sorted list;

    // ReadDir reads the named directory,
    // returning all its directory entries sorted by filename.

Remove the manual sort, and while updating, also skip directories,
because we're looking for files.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.69%. Comparing base (6e9e7b8) to head (4a54a4f).
⚠️ Report is 60 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3275      +/-   ##
==========================================
- Coverage   14.73%   14.69%   -0.04%     
==========================================
  Files         200      200              
  Lines       93077    93028      -49     
==========================================
- Hits        13712    13670      -42     
- Misses      78019    78027       +8     
+ Partials     1346     1331      -15     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies WAL discovery in the raft storage layer by relying on os.ReadDir’s documented sorted output and by ignoring directory entries when collecting WAL filenames.

Changes:

  • Removed the redundant explicit sort of WAL filenames in ListWALs.
  • Skipped directory entries when scanning for *.wal files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thaJeztah
thaJeztah requested review from corhere and vvoland August 1, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants