FAQ: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
(The midas documentation has moved to https://midas.triumf.ca/docs/)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Frequently Asked Questions'''
The midas documentation has moved. The new documentation about the topics on this page is in:
 
* [https://midas.triumf.ca/docs/develop/features/core_system/odb/configuring/#corruption Corruption] on the ODB: configuring page (recovering from a corrupted ODB)
There is a related page of [[Installation/Compilation problems|Common Installation Problems]].
* [https://midas.triumf.ca/docs/develop/features/core_system/odb/configuring/#enlarging-the-available-size Enlarging the available size] on the ODB: configuring page (resizing the ODB)
 
* [https://midas.triumf.ca/docs/develop/reference/reference/odb_keys/#system /System] on the ODB keys page (showing the run state in the odbedit prompt)
{{Pagelinks}}
* [https://midas.triumf.ca/docs/develop/features/deployment/large_experiments/#more-than-256-hotlinks-in-a-program More than 256 hotlinks in a program] on the Large experiments page (increasing the number of hotlinks)
 
== Increasing Number of Hot-links ==
 
<ol>
<li> Use odbedit to save current ODB
<pre>
odbedit
save current_odb.odb
</pre>
<li> Stop all the running MIDAS processes, including mlogger and mserver using the web
interface. Then stop mhttpd as well.
 
<li> Remove your old ODB (we will recreate it after modifying MIDAS, using the backup you just
made).
<pre>
mv .ODB.SHM .ODB.SHM.20161104
rm /dev/shm/thomas_ODB_SHM
</pre>
 
<li> Make the following modifications to midas. In this particular case I have increased the
max number of open records from 256 to 1024. You would need to change the constants if you
want to change to other values
<pre>
diff --git a/include/midas.h b/include/midas.h
index 02b30dd..33be7be 100644
--- a/include/midas.h
+++ b/include/midas.h
@@ -254,7 +254,7 @@ typedef std::vector<std::string> STRING_LIST;
-#define MAX_OPEN_RECORDS      256          /**< number of open DB records  */
+#define MAX_OPEN_RECORDS      1024          /**< number of open DB records  */
diff --git a/src/odb.c b/src/odb.c
index 47ace8f..ac1bef3 100755
--- a/src/odb.c
+++ b/src/odb.c
@@ -699,8 +699,8 @@ static void db_validate_sizes()
-   assert(sizeof(DATABASE_CLIENT) == 2112);
-   assert(sizeof(DATABASE_HEADER) == 135232);
+  assert(sizeof(DATABASE_CLIENT) == 8256);
+  assert(sizeof(DATABASE_HEADER) == 528448);
</pre>
The calculation is as follows (in case you want a different number of open records):  
DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS = 64 + 8*1024 = 8256
DATABASE_HEADER = 64 + 64*DATABASE_CLIENT = 64 + 64*8256 = 528448
 
<li> Rebuild MIDAS
<pre>
make clean; make
</pre>
 
<li> Create new ODB
<pre>
odbedit -s 1000000
</pre>
Note, you should change the size of the ODB to whatever you need.
 
<li> reload your original ODB
<pre>
load  current_odb.odb
</pre>
 
<li> Rebuild your frontend against new MIDAS; then it should work and you should be able to
produce more open records.
</ol>
 
== How to recover from a corrupted ODB ==
 
* Stop your front-ends, [[mlogger]], [[mhttpd]], etc.
* Remove the shared memory associated to ODB buffer. Find the shared memory segment by doing
ls -l /dev/shm
then remove the segment that will be something like /dev/shm/*_test_ODB_SHM
* Move the old ODB files. These will be in the location given by [[Exptab]], e.g. ~/online
cd online
mv .ODB.SHM .ODB.SHM.BAD
* Restart ODB with larger size using [[odbedit]] e.g.
odbedit -s 100000000
* Reload the last saved ODB dump you have (see [[ODB#Save and reload the ODB|save and reload the ODB]]). These dumps are typically called something like 'online/history/*.xml'.
So from  {{Utility|name=odbedit}} you do something like
odbedit> load history/run00071.xml
* Your ODB should now be fixed.
 
Note that sometimes it seems that you also need to remove the buffers associated with the system messages (called SYSMSG) as well as the buffers associated with the ODB.

Latest revision as of 22:00, 30 October 2026

The midas documentation has moved. The new documentation about the topics on this page is in: