This chapter shows you how to perform some common GemStone/S 64 Bit system operations:
Starting the GemStone Server
How to startup the GemStone repository, and troubleshooting Stone startup failures.
Starting a NetLDI
How to start a NetLDI, and troubleshooting NetLDI startup failures.
Starting a GemStone Session
How to login and troubleshooting login failures
Shutting Down Sessions, the Object Server, and NetLDI
How to stop sessions and shut down server processes
Logins without a stone running
How to login a solo session in the absence of a Stone
Recovering from an Unexpected Shutdown
Troubleshooting unexpected shutdowns.
In order to start a Stone repository monitor, the following must be identified through your operating system environment:
The GEMSTONE environment variable must point to the directory where GemStone is installed, such as /users/gemstone. The directory $GEMSTONE/bin should be in your search path for commands.
The repository monitor must find a configuration file. The default is $GEMSTONE/data/system.conf. Other files can supplement or replace the default file; for information, see How GemStone Uses Configuration Files.
The configuration file must give the path to one or more repository files (extents) and to space for transaction logs. The default configuration file specifies $GEMSTONE/data/extent0.dbf for the extent file, and places transaction logs in $GEMSTONE/data/. You may want to move these files to other locations. For further information, see Choosing the Extent Location.
Follow these steps to start GemStone following installation or an orderly shutdown. (To recover from an abnormal shutdown, refer to Recovering from an Unexpected Shutdown.)
Step 1. Set the GEMSTONE environment variable to the full pathname (starting with a slash) of the directory where GemStone is installed. Ordinarily this directory has a name like GemStone64Bit3.5.0-x86_64.Linux (depending on your platform). For example:
$ GEMSTONE=/users/GemStone64Bit3.5.0-x86_64.Linux
$ export GEMSTONE
If you have been using another version of GemStone, be sure you update or unset previous settings of these environment variables:
Step 2. Set your UNIX path. One way to do this is to use one of the gemsetup scripts. There is one version for users of the Bourne and Korn shells and another for users of the C shell. These scripts also set your man page path to include the GemStone man pages. Note that these scripts append to the end of your path or man path; you will need to manually remove references to older versions of GemStone.
(Bourne or Korn shell)
$ . $GEMSTONE/bin/gemsetup.sh
or (C shell)
% source $GEMSTONE/bin/gemsetup.csh
Step 3. Start GemStone by using the startstone command:
% startstone [gemStoneName]
where gemStoneName is optional and is the name you want the repository monitor to have. The default name is gs64stone. See startstone for additional information.
If the Stone repository monitor fails to start in response to a startstone command, it’s likely that the cause is one of the following. Inspect the Stone log for clues (the default location is $GEMSTONE/data/gs64stone.log).
The Stone repository monitor must be able to read the GemStone key file. By default, this is $GEMSTONE/sys/gemstone.key. The location and filename can be configured by the KEYFILE configuration parameter.
Ordinarily, you create the key file during installation from information provided by GemStone. Be careful to enter the information correctly. GemStone key files are platform-specific, and key files for earlier versions may not work with new major releases.
If you do not have a valid key file, contact GemStone Technical Support as described under Technical Support.
The shared page cache monitor must be able to create and attach to the shared memory segment that will serve as the shared page cache. Several factors may prevent this from happening:
If the Stone repository monitor cannot access a repository extent file, it logs a message like the following:
GemStone is unable to open the file $GEMSTONE/data/extent0.dbf
reason = File does not exist
An error occurred opening the repository for exclusive access.
Stone startup has failed.
The reason should provide enough information: the extent file could be missing, the permissions on the file or directory could be set incorrectly, or there may be an error in the configuration file that points to the extents. Correct the problem, then try starting GemStone again.
If another process has an extent file open when you attempt to restart GemStone, a message like the following appears in the Stone log (by default, $GEMSTONE/data/gs64stone.log):
GemStone is unable to open the file $GEMSTONE/data/extent0.dbf
reason = exclusive open: File is open by another process. , file /benton2/users/lalmarod/GS6435/data/extent0.dbf, failed with EWOULDBLOCK
An error occurred opening the repository for exclusive access.
Stone startup has failed.
Close any other Gem sessions (including Topaz sessions) that are accessing the repository you are trying to restart. Use ps -ef (the options on your system may differ) to identify any pgsvrmain processes that are still running, and then use kill processid to terminate them. Try again to start GemStone.
If GemStone attempts to recover from a system crash that occurred just after an extent was created, and GemStone was not able to write a checkpoint when the extent was added, you will find an error message like the following in the Stone log:
Repository was not shutdown cleanly, recovery needed.
fileName !@::1#netldi:51035#dbf!//users/GemStone/data/extent1.dbf
already exists, delete it and restart recovery.
Stone startup has failed.
Check that an extent was being added to the repository at or shortly before the crash. If necessary, look for a message near the end of the Stone log file.
At startup, the GemStone system performs consistency checks on each extent listed in DBF_EXTENT_NAMES.
All extents must have been shut down cleanly with a repository checkpoint the last time the system was run. This consistency check is the only one for which GemStone attempts automatic recovery.
The following consistency checks, if failed, cause the startup sequence to terminate. These failures imply corruption of the disk or file system, or that the extents were modified at the operating system level (such as by cp or copydbf) outside of GemStone’s control and in a manner that has corrupted the repository.
If GemStone cannot find the transaction log file for the period between the last checkpoint and an unexpected shutdown, it puts a message like this in the Stone log:
Extent 0 was not cleanly shutdown; recovery is needed.
<Repository startup statistics>
Repository startup is from checkpoint = (fileId 6, blockId 3)
ERROR: cannot find log file(s) to recover repository.
To proceed without tranlogs and lose transactions committed
since the last checkpoint use "-N" switch on your startstone
command.
An error occurred when attempting to start repository recovery.
Waiting for aiowrites to complete
Stone startup has failed.
If the log file was archived and removed from the log directory, restore the file.
If the log file is no longer available, you can use startstone -N to restart from the most recent checkpoint in the repository. However, any transactions that occurred during the intervening period cannot be recovered.
NOTE
When you use startstone with the -N option, any transactions occurring after the last checkpoint are permanently lost.
If you are still unable to start GemStone or determine the reason that startup is failing, contact your local GemStone administrator or GemStone Technical Support.
If this is an existing GemStone repository and the problems reported on startup attempts indicate that the repository is corrupt, you may need to restore from backups, as described in Chapter 11. See “How to Restore from Backup.
The gslist utility lists all Stone repository monitors, shared page cache monitors, and NetLDIs that are running. The gslist command by itself checks the locks directory (/opt/gemstone/locks, /usr/gemstone/locks, or $GEMSTONE_GLOBAL_DIR/locks) for entries. The -v option causes it to verify that each process is alive and responding. For example:
% gslist -v
Status Version Owner Started Type Name
------ ------- --------- ------------ ------ ----
OK 3.5.0 gsadmin Mar 11 12:02 cache gs64stone~1c9fa07f0412665
OK 3.5.0 gsadmin Mar 11 12:02 Stone gs64stone
OK 3.5.0 gsadmin Mar 11 10:13 Netldi gs64ldi
By default, gslist lists servers on the local node. The -m host option performs the operation on node host, which must have a compatible NetLDI running.
You will usually need to start a GemStone Network Long Distance Information (NetLDI) server when starting a Stone repository monitor. NetLDI servers are needed to start up Gem processes for RPC logins, and for starting up caches on behalf of Gems that are on other nodes.
If you are running distributed configurations, you will need to perform these steps on each node that requires a NetLDI.
To start a NetLDI server, perform the following steps on the node where the NetLDI is to run:
Step 1. Set the GEMSTONE environment variable to the full pathname (starting with a slash) of the directory where GemStone is installed. Ordinarily this directory has a name like GemStone64Bit3.5.0-x86_64.Linux (depending on the platform). For example:
$ GEMSTONE=/installDir/GemStone64Bit3.5.0-x86_64.Linux
$ export GEMSTONE
If you have been using another version of GemStone, be sure you update or unset previous settings of the $GEMSTONE_NRS_ALL environment variable
Step 2. Use one of the gemsetup scripts to set your UNIX path. There is one version for users of the Bourne and Korn shells and another for the C shell. These scripts also set your man page path to include the GemStone man pages.
(Bourne or Korn shell)
$ . $GEMSTONE/bin/gemsetup.sh
or (C shell)
% source $GEMSTONE/bin/gemsetup.csh
Step 3. Start the NetLDI by using the startnetldi command.
% startnetldi
% startnetldi -g -aname
See startnetldi for additional command arguments and further detail. For information about the authentication modes, see under Configuration Decisions.
If the NetLDI service fails to start in response to a startnetldi command, it’s likely that the cause is one of the following:
Check the NetLDI log for clues. By default, the NetLDI log (netLdiName.log) is located in /opt/gemstone/log/. On some systems, this file may be located in /usr/gemstone/log/, and may be overridden using the startnetldi -l argument, or by setting $GEMSTONE_GLOBAL_DIR.
This section tells how to start a GemStone session and log in to the repository monitor. The instructions apply to all logins from the node on which the Stone repository monitor is running.
This section begins with a brief discussion of environmental variables, and then presents two examples. The first example starts a linked application and logs in to GemStone. The second example starts an RPC application, which in turn spawns a separate Gem session process that communicates with the GemStone server.
The examples use Topaz as the application because it is part of the standard GemStone Object Server distribution. Other applications may use different steps to accomplish the same purpose. Some users may prefer to make these steps part of an initialization file.
For an explanation of the difference between linked and RPC sessions, see Linked and RPC Applications.
In order to start a GemStone session, the following must be defined through your operating system environment:
All GemStone users must have a GEMSTONE environment variable that points to the GemStone installation directory, such as
/installDir/GemStone64Bit3.5.0-x86_64.Linux (depending on your platform). The directory $GEMSTONE/bin should be in your search path for commands.
While system defaults, or a system-wide configuration file, can be used to configure Gem sessions, you may want to configure individualized environments and configuration files for specific sessions. This may involve setting an environmental variable, such as GEMSTONE_EXE_CONF. For further information, see How GemStone Uses Configuration Files.
The following steps show how to start a linked application (here, the linked version of Topaz). The steps for setting the GEMSTONE environment variable and the operating system path for a session are the same as those given here for starting a repository monitor. They are repeated here for convenience.
The procedure assumes that the Stone repository monitor has already been started and has the default name gs64stone.
Step 1. Set the GEMSTONE environment variable to the full pathname (starting with a slash) of the directory where GemStone is installed. Ordinarily this directory has a name like GemStone64Bit3.5.0-x86_64.Linux (depending on your platform). For example:
$ GEMSTONE=/installDir/GemStone64Bit3.5.0-x86_64.Linux
$ export GEMSTONE
If you have been using another version on GemStone, be sure you update or delete previous settings of these environment variables:
Step 2. Set your UNIX path. One way to do this is to use one of the gemsetup scripts. There is one version for users of the Bourne and Korn shells and another for users of the C shell. These scripts also set your man page path to include the GemStone man pages.
(Bourne or Korn shell)
$ . $GEMSTONE/bin/gemsetup.sh
or (C shell)
% source $GEMSTONE/bin/gemsetup.csh
% topaz -l
Step 4. Set the UserName login parameter:
topaz> set username DataCurator
Step 5. Log in to the Gem session. It will query you for the password.
topaz> login
GemStone Password?
[Info]: LNK client/gem GCI levels = 35002/35002
--- 03/20/19 17:16:35 PDT Login
[Info]: User ID: DataCurator
[Info]: Repository: gs64stone
[Info]: Session ID: 5
[Info]: GCI Client Host: <Linked>
[Info]: Page server PID: -1
[Info]: using libicu version 58.2
[Info]: Gave this process preference for OOM killer: wrote to
/proc/26091/oom_score_adj value 250
[03/20/19 17:16:35 PDT ]
gci login: currSession 1 linked session
successful login
topaz 1>
At this point, you are logged in to a Gem session process, which is linked with the application. The session process acts as a server to Topaz and as a client to the Stone. Information about Topaz is in the manual GemStone Topaz Programming Environment.
When you are ready to end the GemStone session, you can log out of GemStone and exit Topaz in one step by invoking the Topaz exit command:
topaz 1> exit
The following steps show how to start an RPC application (here, the RPC version of Topaz) on the server node. The procedure assumes that the Stone is running under the default name gs64stone and that you are already set up to run a GemStone session as described in Step 1 and Step 2 of the previous example (“To Start a Linked Session”).
Sessions that login RPC use SRP (Secure Remote Password) and SSL to authenticate passwords for login. If the Gem is running on the server node, the connection reverts to normal socket communication after login completes.
The following steps demonstrate an RPC login from topaz:
Step 1. Use gslist to find out if a NetLDI is already running. The default name for the NetLDI is gs64ldi.
% gslist
Status Version Owner Started Type Name
------ -------- --------- ------------ ------ ----
exists 3.5.0 gsadmin Mar 11 12:02 cache gs64stone~1c9fa07f0412665
exists 3.5.0 gsadmin Mar 11 12:02 Stone gs64stone
exists 3.5.0 gsadmin Mar 11 10:13 Netldi gs64ldi
If necessary, start a NetLDI following the instructions under Starting a NetLDI.
Step 2. Start the RPC application (such as Topaz), then set the UserName.
topaz> set username DataCurator
Step 3. Unless the NetLDI is running in guest mode with a captive account, set the application login parameters, such as HostUserName and HostPassword, after you start the application. For example:
topaz> set hostusername yourUnixId
topaz> set hostpassword yourPassword
Step 4. Set GemNetId (the name of the Gem service to be started) to gemnetobject. This script starts the separate Gem session process for you. For example:
topaz> set gemnetid gemnetobject
Step 5. Log in to the GemStone session.
topaz> login
GemStone Password?
[03/12/2019 11:36:47.777 PDT]
gci login: currSession 1 rpc gem processId 6943 socket 6
successful login
topaz 1>
At this point, you are logged in through a separate Gem session process that acts as a server to Topaz RPC and as a client to the Stone repository monitor.
When you are ready to end the GemStone session, you can log out of GemStone and exit Topaz by in one step by invoking the Topaz exit command:
topaz 1> exit
Several factors may prevent successful login to the repository:
SESSION MAX: The licensed concurrent session max is 10.
SESSION CONFIGURATION: The maximum number of concurrent sessions is 40
Multi-threaded operations use additional slots for their working threads while they are executing. If you are close to your session limit, these operations may prevent other sessions from logging in.
server% ipcs -m
IPC status from <running system> as of Mon March 9 16:21:08 PDT 2019
T ID KEY MODE OWNER GROUP
Shared Memory:
m 25089 0x4c000ed5 --rw-rw---- gsadmin users
Typical problems occur with linked applications, which may be installed without the S bit and therefore rely on group access to the shared page cache and the repository.
Privileges required: SessionAccess.
To identify the sessions currently logged in to GemStone, send the message System class>>currentSessionReport. This message returns an array of internal session numbers and the corresponding UserId, executable, and PID. For example:
topaz 1> printit
System currentSessionsReport
%
2 SymbolUser symbolgem 32103
3 GcUser admingcgem 32210
4 DataCurator gem 21589 on localhost
5 GcUser reclaimgcgem 32213
The session number can be used with other System class methods to stop a particular session. To get the sessionId for the current executing session, use System class >> session.
To get the UserProfile for a given session, execute:
System userProfileForSession:aSessionId
To get the UserProfile for the current session, execute:
System myUserProfile
The method System class>>descriptionOfSession:aSessionId returns an array of descriptive information, which can be used to find out details information and status for any session. This method returns an Array; the values in each slot are defined as follows:
1. The UserProfile of the session; nil if the UserProfile is recently created and not visible from this session's transactional view or the session is in login or processing, or has logged out.
2. A SmallInteger, the process ID of the Gem or topaz -l process .
3. The hostname of the machine running the Gem process. Specifically, the peer's hostname as seen by stone, for the gem to stone network connection used for login. (a String, limited to 127 bytes).
4. Primitive number in which the Gem is executing, or 0 if it is not executing in a long primitive.
5. Time of the session's most recent beginTransaction, commitTransaction, or abortTransaction (from System timeGmt).
6. The session state (a SmallInteger).
7. A SmallInteger whose value is -1 if the session is in transactionless mode, 0 if it is not in a transaction and 1 if it is in a transaction.
8. A Boolean whose value is true if the session is currently referencing the oldest commit record, and false if it is not.
9. The session's serial number (a SmallInteger).
10. The session's sessionId (a SmallInteger).
11. A String containing the IP address of host running the GCI process. If the GCI application is remote, the peer address as seen by the gem of the GCI application to gem network connection. If the GCI application is linked (using libgcilnk*.so or gcilnk*.dll) this is the peer's IP address as seen by stone, for the gem to stone network connection used for login.
12. The priority of the session (a SmallInteger).
13. Unique host ID of the host where the session is running (an Integer)
14. Time of the session's most recent request to stone (from System timeGmt)
15. Time the session logged in (from System timeGmt)
16. Number of commits which have occurred since the session obtained its view.
17. Nil or a String describing a system or gc gem .
18. Number of temporary (uncommitted) object IDs allocated to the session.
19. Number of temporary (non-persistent) page IDs allocated to the session.
20. A SmallInteger, 0 session has not voted, 1 session voting in progress, 2 session has voted, or voting not active.
21. A SmallInteger, processId of the remote GCI client process, or -1 if the session has no remote GCI client.
22. The KerberosPrincipal object used for passwordless login to the session, or nil if passwordless login was not used.
23. The sessionId of the hostagent session through which this session is communicating to stone, or -1 if session is not using a hostagent.
24. SmallInteger listening port if this session is a hostagent, or -1.
Refer the image method comment for the most recent details as elements are added at the end of the array.
Privileges required: SessionAccess and SystemControl
There are a number of methods on System class that can be used to stop a specific session, or all sessions:
stopSession: aSessionId
Stop the specified session; any transactions that the session was in are aborted, and the session is terminated. This method does not stop the GcGems or SymbolGem.
terminateSession: aSessionId timeout: timeoutSeconds
Stop the specified session; any transactions that the session was in are aborted, and the session is terminated. Waiting up to timeoutSeconds for the session to complete terminating before returning. This method can be used to stop the GcGems. but not the SymbolGem.
stopUserSessions
Stops all sessions other than system Gems; does not stop the GcGems nor SymbolGem. Any transactions that any of the sessions were in are aborted.
NOTE
Be aware that it may take as long as a minute for a session to terminate after you send stopSession:.If the Gem is responsive, it usually terminates within milliseconds. However, if a Gem is not active (for example, sleeping or waiting on I/O), the Stone waits one minute for it to respond before forcibly logging it out. You can bypass this timeout by sending terminateSession:timeout:
To verify all user sessions have logged out or been terminated, send the message currentSessionNames to System. For example, using Topaz:
topaz 1> printit
System currentSessionNames
%
session number: 2 UserId: GcUser
session number: 3 UserId: GcUser
session number: 4 UserId: SymbolUser
session number: 5 UserId: DataCurator
The SymbolUser and GcUser sessions are system session and will be shut down cleanly when the stone is shut down. The above example includes session 5, which is the user executing the example code.
After all user sessions have logged out, use the stopstone command, which performs an orderly shutdown in which all committed transactions are written to the extent files.
% stopstone [gemStoneName] [-i]
If you do not supply the name of the Stone repository monitor, stopstone prompts you for one.
The -i option aborts all current (uncommitted) transactions and terminates all active user sessions. If you do not specify this option and other sessions are logged in, GemStone will not shut down and you will receive a message to that effect.
stopstone prompts you to supply a GemStone username and password. The user must have the SystemControl privilege (initially, this privilege is granted to SystemUser and DataCurator).
There is a similar command to shut down the NetLDI network service.
% stopnetldi [netLdiName]
For more information, see the command reference in Appendix B; stopstone and stopnetldi.
If you are logged in to a GemStone session, you can invoke System class>>shutDown, which also requires the SystemControl privilege.
If you must halt a specific Gem session process or GemStone server processes, be sure to use only kill or kill -term so that the Gem or other process can perform an orderly shutdown.
kill -usr1 will not kill the process, but will cause a GemStone process to write its C and Smalltalk call stacks to the process log file. For linked logins, which do not have a separate process, the stack is written to the application’s stdout.
Do NOT use kill -9 or another uncatchable signal, which does not result in a clean shutdown, unless it is unavoidable. On some platforms, particular failures in disk I/O can result in a process that does not respond to kill.
If for some reason you do need to send kill -9 to a shared page cache monitor, use ipcs and ipcrm to identify and free the shared memory and semaphore resources for that cache. If you send kill -9 to a Stone, use ipcs to determine whether ipcrm should be invoked.
Read-only GemStone operations can be performed when a Stone is not running, by using a "solo" session. This makes it simple to set up Smalltalk-based scripting without needing to configure or start a Stone. More details on scripting is provided in the Topaz Users Guide.
Solo logins require access to an extent file, which can be the read-only empty distribution extent. You may also use an extent containing application code, data, or other modifications, provided the following are true for the repository extent:
The configuration parameter GEM_SOLO_EXTENT specifies the extent file to be used by a Solo session. This defaults to the clean, read-only extent within the distribution, $GEMSTONE/bin/extent0.dbf.
Methods that require a connection to a Stone are disallowed in a Solo session; this includes a number of methods in System class and Repository. For example, methods such as markForCollection, reclaimAll, and methods that make and restore backups all require a running Stone. Attempting to execute these methods in a Solo session results in an ImproperOperation Error (#2050).
To login Solo from topaz linked or RPC, execute set solologin on, then login.
topaz> set solologin on
topaz> set username DataCurator password swordfish
topaz> login
[10/19/2018 11:49:11.950 PDT]
gci login: currSession 1 rpc gem processId 20617 socket 6
ReadOnly session
[Info]: Read-Only Repository:
/benton2/users/gsadmin/GemStone64/bin/extent0.dbf
successful Solo login
topaz 1>
The username and password are required; the setting for gemstone is not used. In topaz RPC, you may perform a solo login while also logged into a GemStone Stone, provided the extent file used by the Solo session (by default, $GEMSTONE/bin/extent0.dbf) is not in use.
Each Solo RPC or linked Gem also opens a 10MB read-write temporary file, /tmp/gemRO_pid_extent1.dbf, which is deleted on logout or process exit.
Object creation in a Solo session is limited to temporary object memory, but you may create objects as needed up to the limit of memory. To ensure there is sufficient memory, you may:
GemStone is designed to shut down in response to certain error conditions as a way of minimizing damage to the repository. If GemStone stops unexpectedly, it probably means that one of the following situations has occurred:
When GemStone shuts down unexpectedly, check the message at the end of the Stone log file to begin diagnosing the problem. By default, the Stone log is $GEMSTONE/data/gemStoneName.log, but there are a number of ways that this can be configured. The names and locations of the Stone and other process log files is described under GemStone Process Logs.
Once the problem is identified, your recovery strategy should take into account the interdependence of GemStone system components. For instance, if an extent becomes unavailable, to restart the system and recover you may have to kill the Stone repository monitor if it is still running. The stopstone command won’t work in this situation, since the orderly shutdown process requires the Stone to clean up the repository before it stops.
If you see a shutdown message in the system log file, GemStone has stopped in response to a stopstone command or a Smalltalk System shutdown method, or in response to a kill -TERM:
--- 03/06/19 11:27:59.977 PDT ---
Starting checkpoint for clean shutdown.
Waiting for all tranlog writes to complete before shutdown.
<other shutdown messages>
Waiting for NetWrite thread to stop
Waiting for Page Manager thread to stop
--- 03/06/19 11:28:02 PDT ---
Now stopping GemStone.
After a clean shutdown, restart GemStone in the usual manner. For instructions, see Starting the GemStone Server of this chapter.
GemStone prints several different disk read error messages to the GemStone log file. For example:
Repository Read failure,
fileName = !#dbf!/users/gemstone/data/extent0.dbf
PageId = 94
File = /users/gs64stone/data/extent0.dbf
too few bytes returned from read()
DBF Operation Read; DBF record 94, UNIX codes: errno=34,...
"A read error occurred when accessing the repository."
If you see a message similar to the above, or if your system administrator identifies a disk failure or a corrupted file system, try to copy your extents to another node or back them up immediately. The copies may be bad, but it is worth doing, just in case. If you’re lucky, you may be able to copy them back after the underlying problem is solved and start again with the current committed state of your repository.
Otherwise, you may need to restore the repository. For details, see the restore procedures in Chapter 11.
If you find a message similar to the following in the GemStone log, the shared page cache (SPC) monitor process (shrpcmonitor) died. The SPC monitor log, $GEMSTONE/data/gemStoneName_pcmonnnnn.log,may indicate the reason.
--- 03/06/19 15:07:19 PDT ---
The stone’s connection to the local shared cache monitor was lost.
Error Text: ’Network partner has disconnected.’
The unexpected shutdown of a Gem process may, in rare cases, result in a “stuck spin lock” error that brings down the shared page cache monitor and the Stone. GemStone uses spin locks to coordinate access to critical structures within the cache. In most cases, the monitor can recover if a Gem dies while holding a spin lock, but not all spin locks can be recovered safely. Stuck spin locks may result from a Gem crash, but a typical cause is the use of kill -9 to kill an unwanted Gem process. If you must halt a Gem process, be sure to use only kill or kill -TERM so that the Gem can perform an orderly shutdown.
Use startstone to restart GemStone. For instructions, see Starting the GemStone Server.
If a Gem session process detects a fatal error that would cause it to halt and dump a core image, the Stone repository monitor may do the same when it is notified of the event. This response on the part of the Stone is configurable through the STN_HALT_ON_FATAL_ERR configuration option. When that option is set to True and a Gem encounters a fatal error, the Stone prints a message like this in its log file:
Fatal Internal Error condition in Gem
when halt on fatal error was specified in the config file
By default, STN_HALT_ON_FATAL_ERR is set to False. That setting causes the Stone to attempt to keep running if a Gem encounters a fatal error; it is the recommended setting for GemStone in a production system. You can set STN_HALT_ON_FATAL_ERR to True during development and testing to provide additional checks for potential risks.
In the event of other shutdown messages in the GemStone log:
1. Consider whether the shutdown might have been caused by a disk failure or a corrupt file system, especially if you see an unexpected message such as Object not found. If you suspect one of these conditions, start with a page audit of the repository file (see Repository Page and Object Audit).
If the page audit fails, refer to Disk Failure or File System Corruption, and consult your operating system administrator.
If the audit succeeds, continue to the next step.
2. If you don’t suspect disk failure or a corrupt file system, try using startstone to restart GemStone. For instructions, see Starting the GemStone Server.
3. If the restart fails, you may have to restore the repository. For details, see the restore procedures in Chapter 11.
If the GemStone log doesn’t contain a shutdown message, there has probably been a power failure or an operating system crash. In that event, the Stone repository monitor automatically recovers committed transactions the next time it starts. Use startstone to restart GemStone, as described under Starting the GemStone Server. See startstone for more information on this command.