-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: integrated sqlite db for metadata #21543
Conversation
47a64fb
to
dfe5fa1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some early thoughts, looking great overall
go.mod
Outdated
@@ -58,6 +58,7 @@ require ( | |||
github.com/kevinburke/go-bindata v3.11.0+incompatible | |||
github.com/lib/pq v1.2.0 // indirect | |||
github.com/mattn/go-isatty v0.0.12 | |||
github.com/mattn/go-sqlite3 v1.11.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, why v1.11.0
instead of the lastest v1.14.7
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular reason - v1.11.0
was actually in the go.sum
(has been for a while it looks like...?) so I guess that's why it ended up being v1.11.0
in go.mod
. That's pretty old and there's no specific reason for us to not use the latest version so I updated to v1.14.7
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs some CHANGELOG
ing as well! For something this big I'd probably add a dedicated section at the top about adding sqlite in general (see previous releases where we had blurbs about adding ARM, or about breaking APIs). Then there could be 2 lines in the "new features" section for:
- Adding the
--sqlite-path
config option - Adding the
disk
option to--store
Oh yeah definitely...I updated the change log, let me know if it makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming the CI failure is flakiness
Closes #21260
Closes #21261
This sets up the basic functionality of a sqlite metadata store in the application. There is a wrapper around the
*sql.DB
which provides a few utility methods including flushing the database tables of data for end-to-end testing and applying database migrations upon startup ofinfluxd
.The migration system uses
go-bindata
which is pretty clunky compared to the native embedding that is part ofgo1.16
, and I hope to refactor the migration code when we upgrade.It is also worth pointing out that this includes changes to the flags used to start
influxd
, including:--store
flag used to work with string values ofbolt
ormemory
- it will now work withdisk
ormemory
, and alsobolt
for backwards compatibility. Using eitherdisk
orbolt
utilizes on-disk storage for metadata, whereasmemory
uses temporary in-memory databases for testing purposes.--sqlite-path
flag for specifying the path to the sqlite database! This is comparable to the--bolt-path
and--engine-path
flags. If a--bolt-path
is specified but not a--sqlite-path
, the--sqlite-path
will be set to store the sqlite database with the default name in the same directory as specified by the--bolt-path
.