.TH "doc_decisions_bootstrap_md" 3elektra "Sat Nov 5 2022" "Version 0.9.11" "Elektra" \" -*- nroff -*-
.ad l
.nh
.SH NAME
doc_decisions_bootstrap_md \- Bootstrap 
 
.SH "Problem"
.PP
Currently, the default backend (default\&.ecf) will also be used for bootstrapping\&. There are two problems with this approach:
.PP
.IP "1." 4
Thus the default backend first will be read with parentKey \fCsystem:/elektra\fP and later with parentKey \fCsystem:/\fP, it needs to store absolute paths and thus won't work with most of the plugins (except dump)\&.
.IP "2." 4
When \fCsystem:\fP is large without mount points, everything is reread twice during bootstrapping\&.
.PP
.SH "Constraints"
.PP
.IP "\(bu" 2
Bootstrap should be fast and not unnecessarily read large files
.PP
.SH "Assumptions"
.PP
.SH "Considered Alternatives"
.PP
.IP "\(bu" 2
Implement a hack so that \fCsystem:/elektra\fP is actually read as \fCsystem:/\fP\&. (Will not solve problem 2\&.)
.IP "  \(bu" 4
It's a hack\&.
.IP "  \(bu" 4
Its confusing and does not play well with persistent data with relative key names\&.
.PP

.IP "\(bu" 2
Split up without compatibility mode: would need to migrate all mount points by exporting (with old version!) and then importing (with new version!)
.IP "  \(bu" 4
I consider this too error-prone, people might easily forget to export with the old version and then discard their mount points unintentional\&.
.PP

.PP
.SH "Decision"
.PP
Split up the concepts of default (\fCdefault\&.ecf\fP) and bootstrap (\fCelektra\&.ecf\fP) backend\&. During bootstrap only \fCelektra\&.ecf\fP is read\&. The default backend reading \fCdefault\&.ecf\fP is only relevant as long as no root backend is mounted\&.
.PP
Algorithm:
.PP
.IP "1." 4
try to get system:/elektra using the file elektra\&.ecf (KDB_DB_INIT)
.IP "2." 4
mount the init backend to system:/elektra
.PP
.SH "Rationale"
.PP
.SH "Implications"
.PP
.SH "Related Decisions"
.PP
.SH "Notes"
.PP
Added scripts/upgrade-bootstrap to migrate from previous setups to upgrade to new system, either:
.PP
.IP "\(bu" 2
touch /etc/kdb/elektra\&.ecf (loses old mount points)
.IP "\(bu" 2
or do kdb export system:/elektra/mountpoints, kdb rm -r system:/elektra/mountpoints, kdb import system:/elektra/mountpoints 
.PP

