-
Notifications
You must be signed in to change notification settings - Fork 56
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
Primary Key Should Include node
Column?
#221
Comments
Yes, that column should really be renamed "context". Nodes are a long-deprecated concept. I'm not aware of sqlite supporting multiple concurrent writers to a single database, so I'm not sure how you would expect multiple laminar instances to use the same database. This isn't a use case I've considered. That being said, there should be no problem having separate laminar instances, each with its own sqlite database, and performing queries on the aggregate of these databases, e.g. using ATTACH. Does this satisfy your use case? Or do you explicitly need each instance to have (read) access to the other's database? |
I'd be interested in attempting this refactor if you think it'd be relatively straightforward.
Technically Write-Ahead Logging can do this, but only on the same host. However, this was not my intention or use case. Having multiple laminar instances use the same database is unnecessary, and I don't need concurrent access to happen.
My goal is being able to merge build info and artifacts from all my laminar databases without having primary key collisions. My actual use case is several non-public servers performing builds, and a "frontend" where build statistics (and select artifacts) are available to the general public. Example, given three non-public servers A, B, C plus one public frontend.
Server B is a single board computer.
Server C is a 2U rack-mounted blade server with excessive amounts of RAM and CPU.
The public frontend server is the smallest cloud-based option available.
All servers self-package the shell library when manually pushed from Server B or when frontend has a new stable version. In an ideal world, each server could use laminar's Expanding the primary key to include the I don't have good visibility on what a solution might be, just that the step where I'm merging the databases wouldn't complain about primary keys conflicting if the |
You're welcome to submit a PR for this. No need for an issue as well as the PR.
This is most definitely out of laminar's scope. Furthermore, making It sounds like the simplest solution is just ensuring that names cannot collide when merging, e.g. by adding the server name to the job name. |
In the Laminar SQLite database, the "node" column is not part of the primary key, which limits the use of multiple Laminar instances.
Remote jobs do not meet this need, because having a local and cloud instance of Laminar is necessary for my particular workflow.
Laminar emphasizes the use of contexts rather than nodes (laminar will exit if the
cfg/nodes
path exists), but because the primary key is only including thename
andnumber
columns, any attempt to combine database entries from multiple instances of Laminar will causes some difficulty, as different instances of Laminar with the same job will cause primary key collisions despite having unique contexts.Because Laminar does not auto increment the
number
field (uses SELECT name, MAX), in theory this can be made compatible by including thenode
column in the primary key.Thoughts?
(EDIT: Should the
node
field be refactored tocontext
or similar to finalize the deprecation ofnode
configuration?)The text was updated successfully, but these errors were encountered: