Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  23 Apr 2026, Pavel Murat, Bug Report, increasing the max number of hot links in ODB 
This is a draft message, edit and submit it to make it permanent  
Message ID: 3211     Entry time: 23 Apr 2026     In reply to: 3210
Author: Nick Hastings 
Topic: Bug Report 
Subject: increasing the max number of hot links in ODB 
> Dear MIDAS experts,
> 
> when I attempted to increase the max number of hotlinks in ODB , defined as 
> 
> #define MAX_OPEN_RECORDS       256           /**< number of open DB records   */
> 
> I started running into an assertion in midas/src/odb.cxx
> 
> https://bitbucket.org/tmidas/midas/src/fa5457b5274a6b42c5ed8b6dea5e3cdd43de38fe/src/odb.cxx#lines-1525 :
> 
>   assert(sizeof(DATABASE_CLIENT) == 2112);
> 
> is it possible that the size of the DATABASE_CLIENT structure should be checked against 64+sizeof(OPEN_RECORD)*MAX_OPEN_RECORDS ?
> - 64 clearly can be expressed in a better maintainable form

Yes, this assert needs to be updated if you increase MAX_OPEN_RECORDS. See 
https://daq00.triumf.ca/MidasWiki/index.php/FAQ#Increasing_Number_of_Hot-links

> UPDATE: similar consideration holds for the size of the DATABLE_HEADER structure, which is also checked against a constant
> 
> https://bitbucket.org/tmidas/midas/src/fa5457b5274a6b42c5ed8b6dea5e3cdd43de38fe/src/odb.cxx#lines-1526

Yes DATABASE_HEADER can also be updated, but the associated assert()s need to be updated too.

FYI I have done both of these things and have attached patches.

Cheers,

Nick.
Attachment 1: 0001-Increase-MAX_OPEN_RECORDS-to-increase-the-max-number.patch  2 kB  Uploaded 23 Apr 2026  | Show | Show all
Attachment 2: 0002-Increase-MAX_CLIENTS-from-64-to-256.patch  2 kB  Uploaded 23 Apr 2026  | Show | Show all
ELOG V3.1.4-2e1708b5