login as: ivaldes
ivaldes@IP address password:
Last login: Thu Aug 14 16:59:22 2008 from south124.ich.local
[ivaldes@vista ~]$ su
Password:
[root@vista ivaldes]# su vista
[vista@vista ivaldes]$ gtm
GTM>S DUZ=9
GTM>D ^XUP
Setting up programmer environment
GTM>W $ZS
150374954,XUP+4^XUP,%GTM-E-REQRUNDOWN, Error accessing database /home/vista/EHR/
g/mumps.dat. Must be rundown on cluster node vista.ich.local.
GTM>h
[vista@vista ivaldes]$ echo $GTM_DIST
[vista@vista ivaldes]$ alias GTM
alias GTM='/usr/local/gtm/mumps -direct'
[vista@vista ivaldes]$ alias gtm
alias gtm='/usr/local/gtm/mumps -direct'
[vista@vista ivaldes]$ /usr/local/gtm/mupip rundown
[vista@vista ivaldes]$ /usr/local/gtm/mupip rundown -r "*"
%GTM-I-MUFILRNDWNSUC, File /home/vista/EHR/g/mumps.dat successfully rundown
[vista@vista ivaldes]$ gtm
GTM>S DUZ=9
GTM>D ^XUP
Setting up programmer environment
This is a TEST account.
Terminal Type set to: C-VT320
Select OPTION NAME: EVE
1 EVE Systems Manager Menu
2 EVENT CAPTURE (ECS) EXTRACT AU ECX ECS SOURCE AUDIT Event Capture
(ECS) Extract Audit
3 EVENT CAPTURE DATA ENTRY ECENTER Event Capture Data Entry
4 EVENT CAPTURE EXTRACT ECXEC Event Capture Extract
5 EVENT CAPTURE MANAGEMENT MENU ECMGR Event Capture Management Menu
Press <RETURN> to see more, '^' to exit this list, OR
CHOOSE 1-5: 1 EVE Systems Manager Menu
WARNING -- TASK MANAGER DOESN'T SEEM TO BE RUNNING!!!!
Select Systems Manager Menu Option: taskman Management
WARNING -- TASK MANAGER DOESN'T SEEM TO BE RUNNING!!!!
Select Taskman Management Option: taskman Management Utilities
Select Taskman Management Utilities Option: r
1 Remove Taskman from WAIT State
2 Restart Task Manager
CHOOSE 1-2: 2 Restart Task Manager
ARE YOU SURE YOU WANT TO RESTART TASKMAN? NO//YES (YES)
Restarting...%GTM-E-JOBFAIL, JOB command failure
%GTM-I-TEXT, Error redirecting stdout (creat) to _ZTM0.mjo
%SYSTEM-E-ENO13, Permission denied
%GTM-E-JOBFAIL, JOB command failure
%GTM-I-TEXT, Failed to set STDIN/OUT/ERR for the job
GTM>h
[vista@vista ivaldes]$ whoami
vista
[vista@vista ivaldes]$ pwd
/home/ivaldes
[vista@vista ivaldes]$ cd /home/vista
[vista@vista ~]$ cd log
bash: cd: log: No such file or directory
[vista@vista ~]$ echo $gtmgbldir
/home/vista/EHR/g/mumps.gld
[vista@vista ~]$ cd EHR
[vista@vista EHR]$ ls
env2 g logs o r WVEHR-gui WVEHR-gui.log WVEHR-VOE1.0-GTM-Routines.tgz
[vista@vista EHR]$ cd logs
[vista@vista logs]$ ls
XWBTCPL.mje XWBTCPL.mjo
[vista@vista logs]$ gtm
GTM>S DUZ=9
GTM>D ^XUP
Setting up programmer environment
This is a TEST account.
Terminal Type set to: C-VT320
Select OPTION NAME: EVE
1 EVE Systems Manager Menu
2 EVENT CAPTURE (ECS) EXTRACT AU ECX ECS SOURCE AUDIT Event Capture
(ECS) Extract Audit
3 EVENT CAPTURE DATA ENTRY ECENTER Event Capture Data Entry
4 EVENT CAPTURE EXTRACT ECXEC Event Capture Extract
5 EVENT CAPTURE MANAGEMENT MENU ECMGR Event Capture Management Menu
Press <RETURN> to see more, '^' to exit this list, OR
CHOOSE 1-5: 1 EVE Systems Manager Menu
WARNING -- TASK MANAGER DOESN'T SEEM TO BE RUNNING!!!!
Select Systems Manager Menu Option: taskman Management
WARNING -- TASK MANAGER DOESN'T SEEM TO BE RUNNING!!!!
Select Taskman Management Option: taskman Management Utilities
Select Taskman Management Utilities Option: r
1 Remove Taskman from WAIT State
2 Restart Task Manager
CHOOSE 1-2: 2 Restart Task Manager
ARE YOU SURE YOU WANT TO RESTART TASKMAN? NO//YES (YES)
Restarting...TaskMan restarted!
Select Taskman Management Utilities Option: mtm Monitor Taskman
Checking Taskman. Current $H=61222,63435 (Aug 14, 2008@17:37:15)
RUN NODE=61222,63423 (Aug 14, 2008@17:37:03)
Taskman is current..
Checking the Status List:
Node weight status time $J
EHR:vista RUN T@17:37:03 3863 Main Loop
Checking the Schedule List:
Taskman has 1 task scheduled.
It is not overdue.
Checking the IO Lists:
There are no tasks waiting for devices.
Checking the Job List:
There are no tasks waiting for partitions.
For EHR:CACHEWEB there is 1 tasks. Out Of Service
Checking the Task List:
There are no tasks currently running.
On node EHR:vista there is 1 free Sub-Manager(s). Status: Run
Enter monitor action: UPDATE// ^
Select Taskman Management Utilities Option: halt
Do you really want to halt? YES//
Logged out at Aug 14, 2008 5:37 pm
GTM>h
[vista@vista logs]$
You really ought to consider journaling. See how it's set up on the
latest Toasters, for example, and see how simple it is. The Toaster has
a small shell script that automatically recovers the database from the
journal file on boot up and even starts up Taskman. Of course, if you
like to practice typing... 8-)
Regards
-- Bhaskar
On 08/14/2008 06:49 PM, Ignacio Valdes wrote:
>
> Hello all, We had a power outage with the server going totally down.
> Here is a terminal session dump of what we had to do to get the
> taskman re-started. The only thing that isn't as it is below is that
> one enters 't' and gets taskman up and running. This shows several
> useful commands such as how to find out where gtm exists as well as
> showing how I was in the right id but in the wrong user space
> /home/ivaldes instead of being in /home/vista/EHR
>
[KSB] <...snip...>
_____________
The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________
You can adapt the following to your needs. You will need to turn on
before-image journaling.
The script /etc/init.d/wvehrvoe10 is automatically executed by the
system when it is booted or shut down:
------------------------------------------------------------------------
#! /bin/bash
### BEGIN INIT INFO
# Provides: wvehrvoe10
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PIP V0.1
# Description: Starts and Stops WorldVisA EHR VOE/ 1.0
### END INIT INFO
# Author: K.S. Bhaskar <bha...@worldvista.org>
# Do NOT "set -e"
NAME=wvehrvoe10
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="WorldVistA EHR VOE/ 1.0"
SCRIPTNAME=/etc/init.d/$NAME
#
# Function that starts WorldVistA EHR VOE/ 1.0
#
do_start()
{
su -c /opt/wvehrvoe10/gtm_V5.3-001_i686/wvehrstart wvehr
}
#
# Function that stops WorldVistA EHR VOE/ 1.0
#
do_stop()
{
su -c /opt/wvehrvoe10/gtm_V5.3-001_i686/wvehrstop wvehr
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart|force-reload)
do_stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
:
------------------------------------------------------------------------
It calls the script /opt/wvehrvoe10/gtm_V5.3-001_i686/wvehrstart to
recover the database (effectively a no-op if it was shut down cleanly,
starts Taskman, and removes journal files that are more than three days
old (this is for a demo; adjust to your needs):
------------------------------------------------------------------------
#!/bin/bash
cd `dirname $0`
rm -f tmp/*.mj[oe]
source ./env
$gtm_dist/mupip journal -recover -backward g/mumps.mjl \
&& $gtm_dist/mupip set -journal="enable,on,before" -file g/mumps.dat \
&& ./run START^ZTMB
find g -iname mumps.mjl_* -mtime +3 -exec rm -v {} \;
------------------------------------------------------------------------
The script /opt/wvehrvoe10/gtm_V5.3-001_i686/wvehrstop stops Taskman and
attempts a clean shut down (not always possible):
------------------------------------------------------------------------
#!/bin/bash
cd `dirname $0`
source ./env
./run STOP^ZTMKU <<EOF
y
y
h
EOF
sleep 5
ps -ef | grep mumps | grep -v grep | awk '{print $2}' | xargs kill
2>/dev/null
------------------------------------------------------------------------
I use a small script /opt/wvehrvoe10/gtm_V5.3-001_i686/env to set
environment variables:
------------------------------------------------------------------------
# env - file to be sourced to create VistA environment
#
# This temporary version of the commands to set up the VistA
# environment assumes that the parent and child use the same
# version of GT.M.
export gtmver=`basename $PWD`
if [[ -d ../parent ]] ; then
pushd ../parent/$gtmver 1>/dev/null
source ./env
popd 1>/dev/null
fi
tmp=`dirname $PWD`
tmp0="$PWD/o($PWD/p $PWD/r $tmp/p $tmp/r)"
# If there is an existing $routines, this environment comes before it
if [[ -n $routines ]] ; then
export routines="$tmp0 $routines"
else
export routines="$tmp0"
fi
# If a mumps.dat exists (vs. mumps.dat.gz) then this a usable environment
if [[ -f $PWD/g/mumps.dat ]] ; then export vista_home=$tmp ; fi
source gtm/gtmprofile
export gtmgbldir=$PWD/g/mumps.gld
export gtmroutines="$routines $gtm_dist"
------------------------------------------------------------------------
The net of this is that when the Toaster boots, the database is
recovered, and Taskman started. It doesn't matter whether the system
was shut down cleanly or whether it crashed. I suggest that production
VistA environments, especially in non-ASP environments, be set up along
the lines of the Toaster.
Regards
-- Bhaskar
On 08/15/2008 09:15 AM, I, Valdes wrote:
>
> Many years as a software engineer before medical school ruined the joy
> of typing as well as video games for me... Can you please post the
> script to this thread? -- IV
>
_____________
The menu system should be used for starting the system, and if you insist on
using a script, Expect would be preferable as it would use the menu system.
Currently AND the correct routine that runs with the option that is used for
Taskman in the Menu system is RESTART^ZTMB.
By using the menu system, you know as best as is possible that patches and
checks and balances will be taken into account.
There is a similar startup routine that directly calls routines for starting
VistA for use with Cache circulating.
Doing things the "easy way" looks great when you want to do a demo, but for
productions systems, think seriously about using the menu system. You can
consolidate several items in the menu system into one menu if that would make
it easier for you, but please don't circumvent the checks and balances.
--
Nancy Anthracite
Whether for production or for demo purposes, the reason to script
Taskman startup is to facilitate the packaging of VistA as an
appliance. Are you saying that the wvehrstart script should use
RESTART^ZTMB instead of RESTART^ZTMB?
Regards
-- Bhaskar
> > >- #! /bin/bash
> > >- #!/bin/bash
> > > cd `dirname $0`
> > > rm -f tmp/*.mj[oe]
> > > source ./env
> > > $gtm_dist/mupip journal -recover -backward g/mumps.mjl \
> > > && $gtm_dist/mupip set -journal="enable,on,before" -file g/mumps.dat \
> > > && ./run START^ZTMB
> > > find g -iname mumps.mjl_* -mtime +3 -exec rm -v {} \;
> > > -----------------------------------------------------------------------
> > >-
> > >
> > > The script /opt/wvehrvoe10/gtm_V5.3-001_i686/wvehrstop stops Taskman
> > > and attempts a clean shut down (not always possible):
> > > -----------------------------------------------------------------------
> > >- #!/bin/bash
> > > cd `dirname $0`
> > > source ./env
> > > ./run STOP^ZTMKU <<EOF
> > > y
> > > y
> > > h
> > > EOF
> > > sleep 5
> > > ps -ef | grep mumps | grep -v grep | awk '{print $2}' | xargs kill
> > > 2>/dev/null
> > > -----------------------------------------------------------------------
> > >-
> > >
> > > I use a small script /opt/wvehrvoe10/gtm_V5.3-001_i686/env to set
> > > environment variables:
> > > -----------------------------------------------------------------------
> > >- # env - file to be sourced to create VistA environment
--
Nancy Anthracite
grvb -mbg kvtz <<GLZNOP
oinad
mnjbz
GLZNOP
it means run the command grvb -mbg kvtz, and as its STDIN (standard
input) feed the lines oinad and mnjbz. The GLZNOP on the command line
tells it the marker to look for, and the GLZNOP on a line by itself is a
marker that says no more input is available for the command. EOF is
just slightly more readable to programmers than GLZNOP, but the shell
doesn't care - it just matches the word after the << and the word on a
line by itself.
Regards
-- Bhaskar
On 08/15/2008 06:51 PM, kdt...@gmail.com wrote:
>
> Bhaskar,
>
> I was looking through this script. It looks to me like you are
> preloading responses for the mumps routine. I was trying to figure
> out how to do this a year ago and never got a good answer.
>
> So what are you doing here? It looks like you are redirecting
> standard input. What does that EOF do?
>
> Thanks
> Kevin
>
>
> #!/bin/bash
> cd `dirname $0`
> source ./env
> ./run STOP^ZTMKU <<EOF
> y
> y
> h
> EOF
> sleep 5
> ps -ef | grep mumps | grep -v grep | awk '{print $2}' | xargs kill
> 2>/dev/null
>
>
_____________
As you note, VistA/Fileman does not use MUMPS transaction processing
commands, and therefore, when a database state is recovered from a
crash, it can, and likely will, be Inconsistent. Since VistA has been
designed this way, and has operated for years, my guess is that either
(a) from an application point of view, transaction Consistency is not
important - for example, if a system crashes during registration,
perhaps an incomplete registration means that the patient has to be
re-registered, but and the consequence is simply an unused serial number
or (b) there is application logic to search for and correct Inconsistencies.
It would be good to hear from some application experts on this topic.
Thank you very much.
Regards
-- Bhaskar
_____________
The problem with Brandens story is that his workaround for a non-ACID
crash was to leverage extensive knowledge of how VistA works to figure
out where it was broken. Essentially these kinds of efforts prevent
the "kernelization" of VistA. Important details of how the VistA/MUMPs
works are required in order to fix this type of problem. Issues like
these ensure that VistA usage grows only as fast as VistA "kernel"
expertise, and that grows slowly indeed.
If the VistA project cannot find a way past these kinds of issues it
will be eclipsed by other FOSS projects. Either by VistA-based efforts
like WebVistA (knowing that it is difficult to tell what that looks
like) or by other efforts like OpenMRS, Tolven and ClearHealth proper.
It seems clear that Baskar has done his part. He has exposed an API
from GTM to handle this issue.
What now?
--
Fred Trotter
http://www.fredtrotter.com
You are thinking like a programmer and not like a business person.
Remember that things like ACID properties (and more esoteric things like
two phase commit) are technologies intended to assist in business
continuity in the face of unplanned events. As a geek at heart, I keep
reminding myself that technology is only a means to an end, and not an
end unto itself. VistA (at least DHCP) existed well before ACID
properties and seems to run well. So, I think the questions to ask
(before imposing a requirement of ACIDity) are:
Do the business processes of health care require ACID transaction
properties or are the business processes inherently robust in the face
of non-Atomicity and non-Consistency? [Isolation and Durability are not
at issue here.] If this is the case, is a requirement of ACIDity like
requiring brake fluid for restaurants?
If the answer is that the business processes of health care (at least as
addressed by VistA) are not inherently robust in the face of
non-Atomicity and non-Consistency, then what mechanisms currently exist
in VistA that provide these requirements?
Until we look at the above questions first, looking at ACIDity is like
putting the cart before the horse. Branden was not the first to
experience a VistA system crash. Let's find out what others have done
before him after recovering from a crash.
Regards
-- Bhaskar
_____________
No exactly the opposite.
> As a geek at heart, I keep
> reminding myself that technology is only a means to an end, and not an
> end unto itself. VistA (at least DHCP) existed well before ACID
> properties and seems to run well.
Under the care and feeding of highly trained experts who do nothing else.
My point is not at all that we need ACID, my point is this:
If system crashes require in-depth knowledge of MUMPS/FileMan/VistA to
fix, then users cannot treat VistA as a "kernel". By "kernel" I mean a
reliable platform whose internal workings can safely be ignored if
certain requirements are respected (i.e. the right hardware, MUMPS
implementation, etc etc.)
It would be entirely fine for me to have the VistA community say
"Backup VistA every hour. If the system crashes, reinstall the most
recent good backup, and send a alert that 1 hours worth of data has
been potentially lost"
That's not great... ACID would be better but that is what you had to
do with MySQL for a long time and is an acceptable work-around.
Unacceptable answer is
"Use your extensive understanding of VistA internal state to correct
the values of Globals that were in use at the time of the crash"
That answer implies that you must be a MUMPS expert to support VistA
which is intractable. I am not a C expert but I use the C-based linux
kernel all the time.
I am talking about a business problem in the context of one technical
solution, but my concern is about the business problem.
Fred Trotter asks:...Is it a true statement that ACID compliance for VistA could beimplemented entirely in FileMan? Or would it require more fundamentalchanges in other places?...No, it is not a true statement, because other VistA code changes thedatabase without going thru FileMan calls.
...Well, if someone wants to fund a man-year of retrofitting all VA codewith the TS and TC commands, maybe the VA would be willing to changetheir (SAC) standard, and test and distribute hundreds of transaction-processing changes to their code. But I doubt it, when they don'teven take bug-fixes and functionality enhancements from the outside.
Ok,
I will make my question more specific. Is this paragraph
illustrative of how to handle a crash moving forward? If this is how
crashes are handled, then this is a problem. If there is another
procedure that can be followed, then it is important enough to have a
description on the WorldVistA wiki. Or to have a link from the wiki to
an already published solution. To help, I have created the page:
http://vistapedia.net/index.php?title=Restoring_a_VistA_installation
HTH,
-FT
Is there no way to do this on a meta level? What about executing TS
and TC commands before and after every routine. So that at a minimum
you know roughly in which routine the failure took place.
Perhaps you could have some "named idle journal". So that you could
automatically roll back to a time when at the least nothing was
happening on the system.
Any time I suggest something like this I usually get back that
something like this already happens, or Baskar tells me that GTM
already does something like this. I know I am way way over my head
with regards to how MUMPS works....
Do the business processes of health care require ACID transaction
properties or are the business processes inherently robust in the face
of non-Atomicity and non-Consistency? [Isolation and Durability are not
at issue here.] If this is the case, is a requirement of ACIDity like
requiring brake fluid for restaurants?
If the answer is that the business processes of health care (at least as
addressed by VistA) are not inherently robust in the face of
non-Atomicity and non-Consistency, then what mechanisms currently exist
in VistA that provide these requirements?
Is there no way to do this on a meta level? What about executing TS
and TC commands before and after every routine. So that at a minimum
you know roughly in which routine the failure took place.
-skip "we have met the enemy and he is us." - Pogo
I have not looked in years, are the journal files still just text
files or have they been "updated and improved"?
--
There was some off-list discussion of this topic. To summarize, when
the VA runs VistA, they rely on the MUMPS implementation to restore the
database to the state it was in just before the crash (of course, they
use computer hardware and operating systems that don't make a habit of
crashing). A combination of their business processes and VistA
application logic is such that after a crash, they don't usually need to
go in and make changes - in other words, their business processes are in
a good state when the MUMPS system recovers the database and VistA is
restarted.
I speculate that when units of work need to be done, they are put in
queues (in the database) for Taskman background processes to handle, and
the design of Taskman is such that when the database is recovered, it
picks up unfinished work from the queues. But this is just a guess.
Regards
-- Bhaskar
_____________
-skip "we have met the enemy and he is us." - Pogo
Note that if you have been journaling properly, a rundown is NOT what should initially be done. I am sure Bhaskar will comment here soon.
--
Nancy Anthracite
--
--
http://groups.google.com/group/Hardhats
To unsubscribe, send email to Hardhats+u...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Hardhats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hardhats+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
GT.M - Rock solid. Lightning fast. Secure. Pick any three.