influxdata / influxdata/influxdb

Tech debt: refactor influxd's "run" method for better readability / testability

Open
#19,976 0 comments 0 reactions 0 assignees View on GitHub
area/2.x kind/tech-debt
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

influxd's [`run` method](https://github.com/influxdata/influxdb/blob/master/cmd/influxd/launcher/launcher.go#L658) is ~800 lines long. This makes it very hard to tell how different pieces of the DB interact with and depend on one another during setup, especially when using middleware that doesn't affect types (i.e. applying an authorization wrapper).

It should be possible to refactor `run` into smaller pieces and make it easier to understand.

Contributor guide

Open the contributing guide

Research direction

Start with cmd/influxd/launcher/launcher.go and the run method around line 658. Trace its setup flow and the interactions among the database components and middleware, then split the method into smaller pieces. Done means the setup is easier to understand and the refactored pieces are easier to test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.