BK: file type mismatch in registered files
In some cases files.filetypeid is not the same as corresponding productionoutputfiles.filetypeid (different version). That breaks dirac-bookkeeping-get-stats (returns 0) and probably other functions which use productionoutputfiles in selections.
Example (spotted by Vladimir):
dirac-bookkeeping-get-stats -B /MC/2018/Beam6500GeV-2018-MagUp-Nu1.6-25ns-Pythia8/Sim09m-ReDecay01/Trig0x617d18a4/Reco18/Turbo05-WithTurcal/Stripping34NoPrescalingFlagged/12897090/ALLSTREAMS.DST
Here for production 195444 files are ALLSTREAMS.DST, in files as "ROOT_All" version and in productionputputfiles as "ROOT" version (file types 121 and 77).
EDIT: it seems like current version of insertProductionOutputFiletypes(), used by addProduction() (the only place I have found where productionoutputfiles are inserted by BOOKKEEPINGORACLEDB.insertProdnOutputFtypes) can insert only "ROOT" (and in case of "RAW" - "MDF") version. Yet the table contains "ROOT_All" and "1" versions for most types.
EDIT2: files are registered using explicit type version (at least in processJob()),
EDIT3: insertprotopordoutput() is called by updateprodoutputfiles() in case the record for particular production does not exist yet. This way get file type from already existing files, so it will match.