Skip to content

Conversation

@shikhar
Copy link
Member

@shikhar shikhar commented Jan 26, 2026

@shikhar shikhar marked this pull request as draft January 26, 2026 14:42
@shikhar shikhar changed the title Add local filesystem mode to s2-lite feat(lite): support local filesystem store Jan 26, 2026
@greptile-apps
Copy link

greptile-apps bot commented Jan 26, 2026

Greptile Overview

Greptile Summary

Added local filesystem storage support via --local-root flag (conflicts with --bucket), introduced StoreType enum to centralize store selection logic and default flush intervals, documented PR squash commit behavior in AGENTS.md, and implemented startup sleep for manifest_poll_interval duration after DB initialization to ensure safe fencing of prior instances before serving requests.

Key changes:

  • New --local-root CLI flag enables backing the database with LocalFileSystem instead of S3 or in-memory storage
  • StoreType enum encapsulates store variants and provides store-specific defaults (50ms flush for S3, 5ms for local/in-memory)
  • Startup sleep added between DB build and server start to ensure previous instance is fenced out
  • Dependency updates: slatedb revision bumped, uuid updated to 1.20
  • Documentation improvements for local conventions

Confidence Score: 4/5

  • This PR is safe to merge with only a minor style improvement needed
  • The implementation is well-structured with proper error handling, type safety via the StoreType enum, and correct CLI argument conflicts. The fencing sleep logic appears sound for preventing concurrent access. One minor redundancy exists (.to_path_buf() on line 109) that doesn't affect functionality but could be cleaned up. All changes align with the stated goals and close the referenced issues.
  • No files require special attention - the minor style improvement in lite/src/bin/server.rs is optional

Important Files Changed

Filename Overview
AGENTS.md Documentation updated to simplify tool references and document squash commit behavior
lite/src/bin/server.rs Added local filesystem support via --local-root flag, introduced StoreType enum, and added startup sleep for fencing; minor redundancy in .to_path_buf() call

Sequence Diagram

sequenceDiagram
    participant User
    participant Server as Server Main
    participant StoreInit as init_object_store
    participant Store as ObjectStore
    participant DB as SlateDB
    participant Sleep as Tokio Sleep
    participant Backend
    participant HTTP as HTTP Server

    User->>Server: Start with args (--bucket / --local-root / neither)
    Server->>Server: Parse args & determine StoreType
    alt S3 Bucket
        Server->>StoreInit: StoreType::S3Bucket(bucket)
        StoreInit->>Store: Initialize S3 ObjectStore
    else Local Filesystem
        Server->>StoreInit: StoreType::LocalFileSystem(path)
        StoreInit->>Store: Create directory & LocalFileSystem
    else In-Memory
        Server->>StoreInit: StoreType::InMemory
        StoreInit->>Store: Initialize InMemory store
    end
    Store-->>Server: Arc<dyn ObjectStore>
    
    Server->>Server: Get flush_interval from StoreType.default_flush_interval()
    Server->>DB: Build DB with settings
    DB-->>Server: Db instance
    
    Note over Server,Sleep: Fencing sleep period
    Server->>Sleep: sleep(manifest_poll_interval)
    Sleep-->>Server: Wake up (prior instance fenced out)
    
    Server->>Backend: Create Backend with DB
    Server->>HTTP: Start HTTP/HTTPS server
    HTTP-->>User: Server ready
Loading

@shikhar shikhar changed the title feat(lite): support local filesystem store feat(lite): add local filesystem support Jan 26, 2026
@shikhar shikhar changed the title feat(lite): add local filesystem support feat(lite): add local filesystem support; startup sleep for safe fencing Jan 26, 2026
@shikhar shikhar marked this pull request as ready for review January 26, 2026 16:09
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@shikhar shikhar merged commit eae3a09 into main Jan 26, 2026
5 checks passed
@shikhar shikhar deleted the local-fs branch January 26, 2026 16:26
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.

[lite] local fs support [lite] make new instance wait out sl8 manifest poll interval

2 participants