TODO
author J. Ali Harlow <ali@juiblex.co.uk>
Thu Jul 07 15:18:02 2016 +0100 (2016-07-07)
changeset 480 18c1225cfa1b
parent 318 829d6711b316
permissions -rw-r--r--
Release 0.6.3.100
ali@374
     1
Kris's original TODO list follows:
ali@374
     2
ali@374
     3
----------------------------------------------------------------------
krh@65
     4
Towards replacing rpm + yum (0.1):
krh@65
     5
krh@214
     6
- drop the filelists from the main package set file, split out to a
krh@214
     7
  secondary file.  for package sets that depend on other package sets,
krh@214
     8
  we need to be able to generate properties with owning packages that
krh@214
     9
  are in another set.  this way, a package that requires a file, will
krh@214
    10
  look up the provides in the set and find the package that owns it
krh@214
    11
  and then try mark that for update.
krh@214
    12
krh@82
    13
- installer part:
krh@65
    14
krh@82
    15
   - pre install check; check that dirs can be created (no files where
krh@82
    16
     want to create dirs), move config files according to file
krh@82
    17
     flags. (.rpmnew etc)
krh@65
    18
krh@82
    19
   - store rpm headers for installed packages.
krh@65
    20
krh@214
    21
   - implement rpm uninstall and update.
krh@214
    22
krh@214
    23
   - triggers? just say no?
krh@214
    24
krh@189
    25
- rpm seems to consider glibc > 2.6.90 to mean greater than
krh@189
    26
  2.6.90-anything.  That is, a comparison that doesn't mention the
krh@189
    27
  release field, shouldn't regard the release field of pkgs it
krh@189
    28
  compares against.  glibc-common-2.6.90 has
krh@189
    29
krh@189
    30
	conflicts: glibc < 2.6.90, glibc > 2.6.90
krh@189
    31
krh@189
    32
  since rpm doesn't let you do glibc != 2.6.90, and
krh@189
    33
krh@189
    34
	requires: glibc = 2.6.90
krh@189
    35
krh@189
    36
  will always pull in glibc.  But even with a != relation, would
krh@189
    37
  glibc-2.6.90-16 be equal to 2.6.90?  glibc 2.7.90-8 dropped it in
krh@189
    38
  favor of requires = 2.7.90-8 (#225806).
krh@189
    39
krh@65
    40
- signed packages
krh@65
    41
krh@70
    42
- space calculation before transaction, but ideally, do a number of
krh@70
    43
  smaller transactions.
krh@70
    44
krh@70
    45
- pre-link changing binaries and libs on disk screwing up checksum?
krh@70
    46
krh@82
    47
- pipelined download and install; topo-sort packages in update set,
krh@82
    48
  pick one with all deps in the current set, add it to the current set
krh@82
    49
  and satisfy deps against update set => result: minimal update
krh@82
    50
  transaction.  Queue download and install/update transaction for the
krh@82
    51
  packages in the minimal set, start over.  This also makes the
krh@82
    52
  installation phase much more interruptible, basically just stop
krh@82
    53
  after a sub-transaction finishes.  As we keep the update set around
krh@82
    54
  as a target, we can restart if needed.  Probably don't need to, can
krh@82
    55
  just do a new update.  During a sub-transaction we should keep the
krh@82
    56
  target set (i.e. the current set to be) around as a lock file
richard@310
    57
  (system.rzdb.lock or so, see git) so that razor updates are
krh@82
    58
  prevented if the systems crashes during an update.
krh@74
    59
krh@214
    60
- implement depsolving between multiple package sets by creating an
krh@214
    61
  iterator that has a sorted list of all installed pkgs from all sets,
krh@214
    62
  all installed requires from all sets, all installed provides from
krh@214
    63
  all sets etc.  could be a list of tuples (pkgs index, set index).
krh@214
    64
  should simplify even the two-set depsolving a bit since we can
krh@214
    65
  pretend there's just one set.  this should also be useful for the
krh@214
    66
  'overlay set' idea where the system set is actually made up of a
krh@214
    67
  number of sets, but typically a read-only set from a read-only fs
krh@214
    68
  and a read-write set from a r/w fs.
krh@214
    69
krh@214
    70
- locking: we use advisory file locking on the system set
richard@310
    71
  (/var/lib/razor/system.rzdb) to indicate a transaction is in
krh@214
    72
  progress.  The locking algorithm is as follows:
krh@214
    73
krh@214
    74
    1. obtain advisory lock on system set.  if this is already taken,
krh@214
    75
       we know that a process is actively modifying the system set and
krh@214
    76
       we have to wait.  there's a fcntl that lets you block for the
krh@214
    77
       lock to go away.
krh@214
    78
richard@310
    79
    2. if a system-next.rzdb file already exists an earlier razor
krh@214
    80
       process was interrupted or crashed and we may want to clean
richard@310
    81
       that up.  the system-next.rzdb file will record what the
krh@214
    82
       previous instance was trying to do and we can just replay that
krh@214
    83
       to clean up.
krh@214
    84
krh@214
    85
    3. create the new package set whichever way and write it to
richard@310
    86
       system-next.rzdb, then start installing/removing rpms.
krh@214
    87
richard@310
    88
    4. When the update is complete, rename system-next.rzdb to
richard@310
    89
       system.rzdb and remove the advisory lock.
krh@214
    90
krh@214
    91
  we should probably introduce a new object that encapsulates this
krh@214
    92
  sequence, the filename conventions, rpm cache, e.g. struct
krh@214
    93
  razor_image, with operations such as
krh@214
    94
krh@214
    95
	#define RAZOR_IMAGE_READ	0x01
krh@214
    96
	#define RAZOR_IMAGE_WRITE	0x02
krh@214
    97
krh@214
    98
	struct razor_image *
krh@214
    99
	razor_image_open(const char *root, unsigned int flags);
krh@214
   100
krh@214
   101
	int
krh@214
   102
	razor_image_begin_transaction(struct razor_image *image,
krh@214
   103
				      struct razor_set *target);
krh@214
   104
krh@214
   105
	int
krh@214
   106
	razor_image_finish_transaction(struct razor_image *image);
krh@214
   107
krh@214
   108
  the transaction pipelineing described above sits on top of this,
krh@214
   109
  since each step there needs to complete a full transaction that
krh@214
   110
  writes out a new package set.
krh@214
   111
krh@214
   112
  for overlay package sets we could do something like
krh@214
   113
krh@214
   114
	struct razor_image *
krh@214
   115
	razor_image_open_with_base(const char *root, unsigned int flags,
krh@214
   116
				   struct razor_image *base);
krh@214
   117
krh@214
   118
  where base specifies the r/o package set it's layered on.  this
krh@214
   119
  allows for stacking several layers of images.
krh@214
   120
krh@213
   121
krh@213
   122
Package set file format items:
krh@213
   123
jbowes@318
   124
- nail down byte-order of repo file.
krh@213
   125
krh@213
   126
- version the sections in the file, put the element size in the header
krh@213
   127
  so we can add stuff to elements in a backwards compatible way.
krh@213
   128
  maybe not necessary, we can just add sections that augment the
krh@213
   129
  sections we want to add to (similar to how rpm has add versioned
krh@213
   130
  deps).
krh@213
   131
krh@213
   132
krh@65
   133
Misc ideas:
krh@65
   134
krh@1
   135
- keep history of installed packages/journal of package transaction,
krh@1
   136
  so we can roll back to yesterday, or see what got installed in the
krh@1
   137
  latest yum update.
krh@1
   138
krh@18
   139
- use hash table for package and property lists so we only store
krh@18
   140
  unique lists (like for string pool).
krh@40
   141
krh@40
   142
- use existing, running system as repo; eg
krh@40
   143
krh@40
   144
	razor update razor://other-box.local evince
krh@40
   145
krh@40
   146
  to pull eg the latest evince and dependencies from another box.  We
krh@40
   147
  should be able to regenerate a rzr pkg from the system so we can
krh@40
   148
  reuse the signature from the originating repo.
krh@41
   149
krh@41
   150
- Ok, maybe the fastest package set merge method in the end is to use
krh@41
   151
  the razor_importer, but use a hash table for the properties.  This
krh@41
   152
  way we can assign them unique IDs immediately (like tokenizing
krh@41
   153
  strings).
krh@47
   154
richard@310
   155
- test suite should be easy, just keep .rzdb files around and test
krh@47
   156
  different type of upgrades that way (obsoletes, conflicts, file
krh@47
   157
  conflicts, file/dir problems etc).  Or maybe just keep a simple file
richard@310
   158
  format ad use a custom importer to create the .rzdb files.
krh@47
   159
krh@63
   160
- overlay package sets?  mount a read-only /usr over nfs or from the
krh@63
   161
  virt-host and have a local package set overlaid over the read-only
krh@63
   162
  one.  shouldn't need new features in the core package set data
krh@63
   163
  structure, but should be just conventions on top.  we have the base
krh@63
   164
  package set from the r/o system, the overlay set from the local
krh@63
   165
  system and we can have an effective package set which is the merge
krh@63
   166
  of everything from the overlay into the base set.  the effective set
krh@63
   167
  is easy to compute and we could do it on the fly or cache it.  or
krh@63
   168
  maybe the effective set is the on-disk representation and the
krh@63
   169
  overlay can be computed when needed, we just keep a link back to the
krh@63
   170
  base.
krh@71
   171
krh@71
   172
- incremental rawhide repo updates? instead of downloading 10MB zipped
richard@310
   173
  repo every time, download a diff rzdb?  Should be pretty small,
krh@82
   174
  especially if we don't have file checksums in metadata.  Filenames
krh@82
   175
  and properties are for the most part already present, typically just
krh@82
   176
  a version bump plus maybe tweaking a couple requires.  The upstream
krh@82
   177
  repo can store multiple incremental updates in one big file and
krh@82
   178
  provide an index file that maps updates for a given date (we should
krh@82
   179
  use repo-file checksums though) to a range in the file: Download the
richard@310
   180
  index file, search for a match for your latest rawhide.rzdb file,
krh@82
   181
  download range of updates that brings it up to date.
krh@74
   182
krh@74
   183
- use hash tables for dirs when importing files to avoid qsorting all
krh@74
   184
  files in rawhide.
krh@75
   185
krh@82
   186
Bugs:
krh@82
   187
krh@82
   188
- eliminate duplicate entries in package property lists.