Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  31 Mar 2022, Stefan Ritt, Suggestion, Maximum ODB size 
    Reply  04 Apr 2022, Konstantin Olchanski, Suggestion, Maximum ODB size 
       Reply  27 Apr 2023, Marius Koeppel, Suggestion, Maximum ODB size 
          Reply  27 Apr 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
             Reply  27 Apr 2023, Marius Koeppel, Suggestion, Maximum ODB size 
                Reply  27 Apr 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                Reply  27 Apr 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                   Reply  28 Apr 2023, Marius Koeppel, Suggestion, Maximum ODB size create_time.pdffails.pdftest_odb.py
                      Reply  28 Apr 2023, Stefan Ritt, Suggestion, Maximum ODB size 
                         Reply  28 Apr 2023, Marius Koeppel, Suggestion, Maximum ODB size 
                         Reply  28 Apr 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
             Reply  27 Apr 2023, Stefan Ritt, Suggestion, Maximum ODB size 
                Reply  28 Apr 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                   Reply  09 Jun 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                      Reply  12 Jun 2023, Stefan Ritt, Suggestion, Maximum ODB size 
                         Reply  12 Jun 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                            Reply  13 Jun 2023, Stefan Ritt, Suggestion, Maximum ODB size 
                               Reply  13 Jun 2023, Marius Koeppel, Suggestion, Maximum ODB size 
                                  Reply  13 Jun 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                               Reply  13 Jun 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                                  Reply  13 Jun 2023, Stefan Ritt, Suggestion, Maximum ODB size 
                                     Reply  13 Jun 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                                        Reply  13 Jun 2023, Stefan Ritt, Suggestion, Maximum ODB size 
                                           Reply  15 Jun 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
                                              Reply  28 Jul 2023, Stefan Ritt, Suggestion, Maximum ODB size 
                                                 Reply  09 Aug 2023, Konstantin Olchanski, Suggestion, Maximum ODB size 
Message ID: 2541     Entry time: 15 Jun 2023     In reply to: 2539     Reply to this: 2565
Author: Konstantin Olchanski 
Topic: Suggestion 
Subject: Maximum ODB size 
> 
> > are you sure? when/how often does "last midas program finishes" happen? it does not happen on a system crash, not on power loss, not on "shutdown -r now" 
> > (I am pretty sure). In the experiments you run, how often do you shut down all programs (and check that you did not forget one somehow)?
> 
> Indeed this is almost never the case, maybe once per months. On the other hand, we have a complete crash of the os maybe once a year. Most of the time the programs 
> run continuously (we do not need odbedit), so our timestamp is typically one or two days old, so not good either.
> 
> > my vote is to undo this change, it is dangerous because it causes odb to be saved to ODB.SHM never.
> 
> My vote is to flush the odb either periodically or after each run.
> 

So we are in agreement.

RFE filed:
https://bitbucket.org/tmidas/midas/issues/367/odb-should-be-saved-to-disk-periodically

Dangerous change reverted:
60e4c44ad66346b89ba057391acf7a02890049be

K.O.

bash-3.2$ git diff
diff --git a/src/odb.cxx b/src/odb.cxx
index 0d3b88c2..d104ff28 100644
--- a/src/odb.cxx
+++ b/src/odb.cxx
@@ -2199,7 +2199,14 @@ INT db_close_database(HNDLE hDB)
       destroy_flag = (pheader->num_clients == 0);
 
       /* flush shared memory to disk */
-      if (destroy_flag)
+
+      /* if we save ODB to disk only after last client finishes, we will never save ODB to disk
+         in most experiments - none of them ever completely stop MIDAS in normal operation.
+         as result, all changes to ODB contents will be lost on system crash, power loss
+         or normal reboot. see https://daq00.triumf.ca/elog-midas/Midas/2539
+         K.O. June 2023. */
+
+      if (1 || destroy_flag)
          ss_shm_flush(pheader->name, pdb->shm_adr, pdb->shm_size, pdb->shm_handle);
 
       strlcpy(xname, pheader->name, sizeof(xname));

K.O.
ELOG V3.1.4-2e1708b5