This chapter describes changes and new features that apply to the administration of a GemStone Repository, and changes in the GemStone environment, configuration, and tools, including:
Changes in Users and ObjectSecurityPolicies
Changes in Configuration File Handling
Other Changes related to Administrative Operations
Changes in Environment Variables
Configuration Parameter Changes
Changes in Statmonitor and Cache Statistics
A new feature has been added, to allow a session to create a one-time, time-limited password for a specific UserProfile, which will allow a login as that user without further authentication. This allows, for example, writing code that uses GsExternalSession to login other sessions to divide tasks over multiple sessions, without needing to hard-code the GemStone password in code or query for it on the command line. The current session’s authentication is "carried over" for a one-time authentication without re-entering a password. One time passwords can be used to login as the same user as the current session or another user configured on the session’s allowlist of UserProfiles.
Topaz and GsTsExternalSession/GsExternalSession include additional methods to support one-time passwords. With GemBuilder for C, you must specify the new flag GCI_ONETIME_PASSWORD with the login parameters using GciLoginEx() or GciLoginEx_(). GemBuilder for Smalltalk products do not yet support one-time password login.
Only userIds with the new privilege #CreateOnetimePassword can create one-time passwords. This is granted by default to SystemUser and DataCurator.
Temporary passwords cannot be created to login as SystemUser.
In addition to being able to login a second session as your own UserProfile, one-time passwords can also be created for other UserProfiles. Creating a one-time password for another UserProfile requires that the other UserProfile be on this session’s allowlist of UserProfiles.
Adding a UserProfile to the allowlist requires #OtherPassword privilege. Once the whitelist is updated, #OtherPassword is not needed to create a temporary password, only #CreateOnetimePassword is needed.
Methods to create a one-time passwords are in GsCurrentSession. The one-time password is registered in the Stone, but not persisted (no commit is needed). The UserId and this one-time password can be used for a single login within the specified time window. After the successful login or the timeout has elapsed, the one-time password is no longer usable.
The GemStone GCI login functions GciLogin() and GciTsLogin() include a new flag, GCI_ONETIME_PASSWORD, that must be set in order to perform a login using a one-time password. This can be set using new methods in GsTsExternalSession and GsExternalSession, and a new command in topaz. The one-time password can be used to login using GsTsExternalSession or GsExternalSession (the expected use), and can also be used to login using topaz (linked or RPC). Other tools can be used provided that they support the GCI_ONETIME_PASSWORD flag.
The following example is executed as DataCurator, and presumes the existence of a GemStone UserProfile with the userId SubordinateUser.
First, DataCurator adds SubordinateUser to their allowlist:
System myUserProfile addOnetimePasswordUserId: 'SubordinateUser'.
Then, a temporary password is created:
tempPW := GsCurrentSession currentSession
createOnetimePasswordForUserId: 'SubordinateUser'
validForSeconds: 30.
To use this password to login an external session:
sess := (GsTsExternalSession newDefault)
username: 'SubordinateUser';
onetimePassword: tempPW;
yourself.
sess login.
To use one-time passwords in topaz, a new command has been added.
set onetimepassword onOrOff
Determines if the password is a normal GemStone password or a special one-time password. When OFF, the default, the password field is interpreted as a normal GemStone password. When ON, the password field is interpreted as a onetime password.
The login log feature allows you to enable logging of logins and logouts for a repository, using the STN_LOGIN_LOG_ENABLED configuration parameter.
The file generated when login logging is enabled now includes two additional fields for each entry:
ParentUserProfile - OOP of the UserProfile that created the token used for login or 20 (OOP_NIL) if no token was used.
ParentPid - process ID of the parent session that created the token used for login or -1 if no token was used.
One-time logins that fail to login due to a mismatch in UserId and one-time password, or an invalid or expired password are also reported.
The results of System >> descriptionOfSession: now includes additional fields (note that a new entry 25 has also been added; see here):
26. UserProfile which created the onetime password for the session, or nil if no onetime password was used.
27. Process ID of the gem that created the onetime password for the session, or -1 if no onetime password was used.
The follow cache statistics have been added:
OnetimePasswordsActive (Stn)
Number of onetime passwords in the stone's hash map.
OnetimePasswordsCreated (Gem)
Number of onetime passwords this session has created.
OnetimePasswordsExpired (Stn)
Number of expired onetime passwords automatically removed by stone.
OnetimePasswordsNotValidated (Stn)
Number of failed onetime password validations.
OnetimePasswordsTotal (Stn)
Number of onetime passwords ever created by any session since the stone was started.
OnetimePasswordsValidated (Stn)
Number of successful onetime password validations.
OnetimePasswordUsed (Gem)
A boolean with value 1 if the session used a onetime password to login, otherwise 0.
The privilege #CreateOnetimePassword has been added. This privilege is granted to DataCurator and SystemUser, but existing and newly created users will not have this privilege.
GsCurrentSession >> createOnetimePasswordForUserId: aUserId validForSeconds: seconds
GsCurrentSession >> createOnetimePasswordForUserProfile: aUserProfile validForSeconds: seconds
GsCurrentSession >> createOnetimePasswordValidForSeconds: seconds
GemStoneParameters >> onetimePassword: pword
GemStoneParameters >> onetimePasswordFlag
GemStoneParameters >> onetimePasswordLoginFlags
GemStoneParameters >> setLoginWithOnetimePassword
GsExternalSession >> onetimePassword: aString
GsTsExternalSession >> onetimePassword: aString
UserProfile >> addOnetimePasswordUserId: aUserId
UserProfile >> addOnetimePasswordUserProfile: aUserProfile
UserProfile >> addOnetimePasswordUserProfiles: anArray
UserProfile >> onetimePasswordUserProfiles
UserProfile >> removeAllOnetimePasswordUserProfiles
UserProfile >> removeOnetimePasswordUserId: aUserId
UserProfile >> removeOnetimePasswordUserProfile: aUserProfile
UserProfile >> removeOnetimePasswordUserProfiles: anArray
This new privilege allows creating a one-time password that allow another session to login; see One-time Password for details.
This privilege was present in earlier versions, but not implemented. This privilege is required for the new optimized instance migration; see Multithreaded Instance Migration.
GemStone programmatic fullBackup and secureFullBackup allow you to compress backups using gzip (zlib) or lz4. Generally speaking, lz4 backups are faster but do not compress as much.
Both gzip and lz4 support different compression levels, with lower compression level values providing faster performance with less compression. gzip supports compression levels 1 to 9, while lz4 supports 0 to 12. For GemStone backups, the upper ranges provide little addition compression and take much longer.
In previous releases, the default for lz4-compressed fullBackup was level 3. Since the reason for using lz4 rather than gz is generally performance, this has been changed so the default is now level 0. This is the same compression level as the default for secure lz4 compressed backup.
Repository >> fullBackupTo: fileNames MBytes: mByteLimit compressKind: anInt bufSize: count
Repository >> secureFullBackupTo: fileNames MBytes: mByteLimit compressKind: anInt bufSize: count encryptKind: encKind ...
now accept for anInt not only 0, 1 (for gzip), and 2 (for lz4), but also additional values to indicate compression level. 101... 109 indicate various gzip compression levels, and 200--212 indicate the various lz4 compression levels.
New methods have been also added to allow you to specify the particular level of compression you wish to use. These methods are variants of existing methods with the added compressLevel: argument.
Repository >> fullBackupGzCompressedTo: fileNames MBytes: mByteLimit compressLevel: cLevel
Repository >> fullBackupLz4CompressedTo: fileNames MBytes: mByteLimit compressLevel: cLevel
Repository >> secureGzFullBackupTo: fileNames MBytes: mByteLimit compressLevel: cLevel bufSize: count encryptKind: encKind publicKeyCerts: anArrayOrString signatureHashKind: hashKind signingKey: signingKeyFn signingKeyPassphrase: aPassphrase numThreads: numThreads
Repository >> secureLz4FullBackupTo: fileNames MBytes: mByteLimit compressLevel: cLevel bufSize: count encryptKind: encKind publicKeyCerts: anArrayOrString signatureHashKind: hashKind signingKey: signingKeyFn signingKeyPassphrase: aPassphrase numThreads: numThreads
A number of repository scan operations that were previously disallowed in solo sessions can now be used.
This includes Repository methods for allInstances*, listInstances*, allReferences*, listReferences*, and related methods; and GsObjectInventory scans.
When a repository is in restore mode, it cannot create new Symbols, since Symbols are canonicalized and require the SymbolGem to commit, which would create a state difference between the restoring repository and the repository it is restoring from. This created problems executing code that includes arguments or temporary variables with names that did not already exist in the repository, since variable names are created as symbols for efficiency.
Now, when the repository is in restore mode, temporary variable names in compiled code are created as Strings, which will not require the SymbolGem commit. (#49984)
A process that allows upgrade of a hot standby configuration without having to recreate the slave was introduced in recent 3.6.x releases.
A number of methods have been added to make this process somewhat more streamlined; these added methods are describe in the following sections.
The documentation for this process is now provided as a supplemental document, at this location: https://docs.gemtalksystems.com/current/upgradeViaHotStandby.
Note that v3.7 includes a symbol, #OptimizedSelectors, that impacts upgrade via hot standby. If using the upgrade via hot standby process to upgrade from v3.6.x to 3.7.x, you must first resolve this symbol in the 3.6.6 environment. See the documentation for details.
Repository >> suspendCommitsForFailover should no longer be used; instead, use the alternate method Repository >> failOverToSlave.
suspendCommitsForFailover allowed you to keep the master system running as a master, while you created a forked duplicate system on the slave node. After suspendCommitsForFailover to setup the former slave as a master, you have two masters that are not compatible, since they have separate, incompatible tranlog sequences. With suspendCommitsForFailover, to setup the former master as a slave of the new master, you had to restore a new backup of the former slave, new master, into the former master.
If you do want to continue running the master as an independent fork along with the system running on the former-slave, execute commitRestore on the former master after executing failOverToSlave.
As in previous releases, it is possible for multiple slave stones to be restoring from a single master stone. While only one logsender (the primary logsender) can attach to the master stone, the primary logsender may service up to 5 slave logreceivers. Additional logsenders can run on the master node; these read from the tranlogs, but are not attached to the Stone, so the master Stone is not aware of them, and they are not notified if, for example, another tranlog directory is added.
The first Slave system’s logreceiver to connect to the Master’s primary logsender is the one for which failOverStatus is reported. There is no other difference between multiple slaves, other than this reporting information. If the system is restarted with the slaves connected in a different order, the failOverStatus information may not describe the same slave as before the restart. When you have multiple slaves, it is recommended to use the new gslist options (described here) rather than failOverStatus.
A failOverToSlave operation prepares all slaves to become the new master; whichever slave performs the commitRestore, and the application API connects to, will be the new master. The other slaves can seamlessly connect to this new master.
The failOverStatus method results now include more details about the status of the master Stone executing it, and the slave Stone being restored into (the first to attach to the logsender, if there is more than one slave). This includes the most recent tranlog record as well as the most recent checkpoint, and other critical information on the master repository. This allows you to verify the exact restore status of the slave and compare to the status of the current master.
This repository last tranlog commit file 6 record 206
last checkpoint file 6 record 15
Other repository restored to commit file 6 record 77
last restored checkpoint file 6 record 15
This repository commits allowed
Note that this may be misleading if you have multiple slaves. If you have more than one slave, you may check on the intended failover slave itself, or use gslist -j -v logsender, as described here.
These methods available in previous releases waited for up to 20 minutes for the logreceiver to start writing log records, before giving up and returning an error. It is possible that very slow hosts under certain circumstances could take this long to start writing logs.
The timeout has been decreased to a more reasonable 60 seconds. Additional methods have been added that include an explicit timeout:
Repository >> continuousRestoreFromArchiveLogs:timeout:
Repository >> continuousRestoreFromArchiveLogs: withDelay:timeout:
These methods are similar to the existing methods, but will timeout and error after the given number of seconds.
You may now stop the primary logsender and the logreceiver using Smalltalk expressions. The following methods have been added.
Note that these methods are in System class and require SystemControl privilege, as with any method that terminates server processes.
System class >> killLogReceiver
Causes stone to send SIGTERM to the log receiver process. Returns true if the SIGTERM signal was sent, false if no signal was sent because no log receiver process was running or a SIGTERM signal had already been sent.
System class >> killLogSender
Causes stone to send SIGTERM to the log sender process. Returns true if the SIGTERM signal was sent, false if no signal was sent because no log sender process was running or a SIGTERM signal had already been sent.
This method now will stop the logreceiver, if it is running, as well as stopping continuous restore. (#50512)
logsenders and logreceivers write keys into the locks directory, which allows them to be queried by gslist. This provides a way to see the status of all logsenders or logreceivers.
gslist has a new features which allows you to query for information on a logsender and all the logreceivers attached to it; using gslist -j -v (both options are required).
For example, the following is the output on the Stone’s node, for a system running on host benton, with a primary slave on host fossa and a secondary slave on host santiam, on the stone’s node. The "statusInMasterCache:true" indicates that this is the primary slave, whose details are reported by failOverStatus.
os$ gslist -v -j logsender_57222
{"GemStoneServers":[
{
"Name":"logsender_57222",
"Host":"benton",
"HostId":"69621bb0476b1937",
"Ip":"10.94.441.15",
"Status":"OK",
"Type":"Logsender",
"Version":"3.7.0",
"Creator":"lalmarod",
"Started":"2023-04-12T18:13:29.000-08:00",
"Pid": 15613,
"Port": 57222,
"Options":{
"-d":null,
"-P":"57222",
"-A":"benton.gemtalksystems.com",
"-l":"/benton/admin/logs/logsender57222.log",
"-s":"bentonstone"
},
"LogName":"/benton/admin/logs/logsender57222.log",
"Sysconf":null,
"Execonf":null,
"GEMSTONE":"/benton/admin/GS6437",
"Exe":"/benton/admin/GS6437/sys/gem",
"Logreceivers":[ {
"StatusInMasterCache":"true",
"PeerIp":"10.94.441.127",
"PeerHost":"fossa.gemtalksystems.com",
"ProcessId": 3637081,
"ReplayedCommit":{"File": 4,"Record": 5235},
"ReplayedCheckpoint":{"File": 4,"Record": 5235}
},
{
"StatusInMasterCache":"false",
"PeerIp":"10.94.441.104",
"PeerHost":"santiam.gemtalksystems.com",
"ProcessId": 791089,
"ReplayedCommit":{"File": 4,"Record": 5235},
"ReplayedCheckpoint":{"File": 4,"Record": 5235}
},
]
When a repository has very long object chains, performance of markForCollection can become slow. The code was improved substantially in v3.6.5 (bug 50025). v3.7 includes additional improvements; thread sleep time has adjustments to moderately improve performance under these circumstances.
To accommodate shorter waits on modern hardware, several configuration parameters have been renamed and are specified in smaller units.
While application settings in earlier released are converted to the new units, it is strongly recommended to review these settings and adjust or reset them to default values. Old settings may limit system commit performance.
The configuration file value for STN_NUM_GC_RECLAIM_SESSIONS is now used to ensure that the AdminGem uses a number of threads appropriate for the repository configuration to perform write set union sweep and epoch.
In 3.7, when an epoch or write set union sweep is run, the AdminGem uses the Stone’s computed value for STN_NUM_GC_RECLAIM_SESSIONS. The larger of this value or the AdminGem’s setting for #epochGcMaxThreads or #sweepWsUnionMaxThreads, is used to determine the number of AdminGem threads used to perform the operation. The number of threads used is printed in the AdminGem’s log entry for the operation.
System class >> changeNumberOfReclaimThreads:
Which has identical behavior as the existing method System class >> changeNumberOfReclaimGemSessions:. The older method continues to be usable and is not deprecated. The new method is preferred; the name reflects the current reclaim implementation.
The ReclaimGem configuration option #verboseLogging now has multiple levels. Higher levels may produce a very large amount of output for debugging errors and evaluating performance, and are not recommended for general use.
For compatibility with earlier versions of GemStone, in which only booleans were expected, true and false are accepted: false = 0 and true = 1.
These are the definitions for the levels:
0 - only summary information every 5 minutes in slow, 15 minutes in a fast
1 - log sigAbort, gcGemAlert, gcHwPage, etc
2 - numDead from stone, numDead processed per thread
3 - summary: commitCount, stayInTrans, crPage, numLive, numDead, numReclPages
6 - num live and dead found per page
7 - summary of info added to ot slot
The default ReclaimGem logging (with level 0) is now on one line, making the log easier to read. Note at this level, summaries of reclaim operations are printed every 15 minutes.
GemStone has a number of ways that executable and system configuration files can be located and specified, and the ways gemnetobject scripts can be specified and located. Some details were missing or unclear in the documentation, and a number of inconsistent or incorrect behaviors have been adjusted.
The number of options and combinatorics could make it difficult to determine why a specific configuration file was selected and used. The startup output and log files now include further details on the environment variables and arguments that affect this.
To bypass the sometimes confusing defaults, the -E argument has been added to a number of utilities. This is the equivalent of -e, but disables the default search locations.
The documentation in the System Administration Guide, Appendix A, has been extensively updated to clarify the specification options, precedence, and default file names for executable and system configuration files.
startstone, startnetldi, topaz, and gemnetobject now include the -E argument, which specifies a configuration file (not a directory).
When the -E argument is specified, use of the GEMSTONE_EXE_CONF and GEMSTONE_SYS_CONF environment variables is disabled, and the process does not search for default-named files (such as system.conf, hostname.conf, stonename.conf, and gem.conf) in any of the usual default locations.
When using the -E argument, the internal environment variable GEMSTONE_DATA_DIR is set to the directory in which the -E argument file is located. This can be used along with the $GEMSTONE/bin/gemstone_data.conf configuration file to setup a GemStone installation. This location is also used for GemStone system log files.
An additional template configuration file, gemstone_data.conf, is now provided in the distribution. This specifies a default location for the extents and transaction logs relative to a configuration file path, rather than using $GEMSTONE/data. This is intended to facilitate RPM installations, in which the GemStone distribution is installed in a shared, read-only location and thus using $GEMSTONE/data for application files is not appropriate.
$GEMSTONE/bin/gemstone_data.conf specifies the location for extents and transaction logs using the internal environment variable GEMSTONE_DATA_DIR. This variable is not set directly by the user. Rather, when using the -E argument to startstone or other utilities, GEMSTONE_DATA_DIR is defined as the directory in which this configuration file is located.
During the upgrade process, after the stone has started but before upgradeImage has completed, logins may fail with a bad Gem version error, which prevents cache warming from happening. Since cache warming may result in faster upgrade, it is now allowed for cachewarmers to login before upgradeImage has completed.
SuperDoit solo scripts by default use a Rowanized extent ($GEMSTONE/bin/extent0.rowan.dbf), although it was possible to configure a script to use the base gemstone extent ($GEMSTONE/bin/extent0.dbf). In most cases, script behavior was identical between the base image and Rowan.
Now, the solo script may invoke a new support script, $GEMSTONE/bin/superdoit_baseimage_solo, that uses the base image, to more easily configuration a script for situations in which a Rowan image is not suitable.
A solo session (a GemStone login that does not connect to a Stone process) has no transactional behavior nor ability to make persistent changes. System class >> commitTransaction has always been disallowed in solo sessions.
When converting existing scripts to solo, calls to System class >> abortTransaction or System class >> beginTransaction that had been present within the scripts previously, could result in losing changes to persistent objects that cannot be committed in a solo session (such as adding classes to UserGlobals).
To make code conversion more reliable, abortTransaction now signals an error if invoked in a solo session where changes to persistent objects would be lost. This allows you to find and remove the abort.
A new method, System class >> soloAbort, can be used within a solo session to perform a logical abort.
System class >> beginTransaction is also disallowed, if in a solo session and changes to persistent objects would be lost.
Up to five sessions can hold the GcLock. The method System class >> sessionIdHoldingGcLock and the statistic SessionWithGcLock reported only the last session to get a lock, and was cleared whenever a session released its lock, even if other sessions held a lock.
sessionIdHoldingGcLock remains, but is deprecated.
The following methods have been added:
System class >> sessionsHoldingGcLock
Returns an Array of sessionIds of sessions holding a garbage collection or repository scan lock.
System class >> gcLocksCount
Returns a SmallInteger which is the number of sessions holding a garbage collection or repository scan lock, or 0 if the lock is free.
System class >> gcLocksReport
Returns a string report on the GcLocks.
System class >> descriptionOfSession: now includes an additional field providing the session lock held by the given session:
25. gcLockKind. 0 or the type of gcLock or repository scan lock held by the session.
The associated cache statistics SessionWithGcLock, which reported the session holding the lock, is replaced by SessionsWithGcLock, which reports the number of sessions holding the lock. GcLockKind is now a per-session stat, describing the kind of lock that this session is holding.
The following methods have been added to support repository analysis.
Object >> recursiveSize
Returns an Array of the form { size . numberOfObjects } where size is approximate physical size on disk of an object and all of the objects referenced by it and numberOfObjects is the count of those objects. Excludes referenced objects in the symbolList, referenced Symbols and referenced special objects.
Object >> recursiveSizeInMemory
Returns an Array of the form { size . numberOfObjects } where size is approximate physical size on disk of an object and all of the objects referenced by it and numberOfObjects is the count of those objects. Excludes committed objects in memory unless those objects have uncommitted changes. Excludes referenced objects in the symbolList, referenced Symbols and referenced special objects.
Object >> recursiveSizeInMemoryReport
Return the result of recursiveSizeInMemory as a readable String.
Object >> recursiveSizeReport
Return the result of recursiveSize as a readable String.
The following methods have been added:
Object >> fastAllReferences
Same as Object >> findAllReferences, but uses more threads.
Object >> fastPrivateReferences
Same as Object >> findAllReferences, but uses more threads, and returns references from internal nodes of large objects and Nscs.
Previously, using a number of debugging environment variables to print tracing information to log files was disallowed on fast (normal) builds, for security reasons. Now, sensitive information is redacted, so use of these environment variable in regular fast builds is allowed.
The affected environment variables are:
GS_DEBUG_SSL_LOG_DIR
when set to a directory, enables logging of SSL calls to a file named GsSSLDebug_pid.log
GS_DEBUG_SSO_LOG_DIR
when set to a directory, enables logging of Kerberos/single sign-on calls to a file named GsSSODebug_pid.log
GS_DEBUG_LIBSSH_DIR
when set to a directory, enables logging of SSH calls to a file named GsSSHDebug_pid.log
The previous debugging trace information was supported by GS_DEBUG_LDAP, which wrote information to stdout. This variable remains, but a new environment variable has been added to support writing trace information to a file.
GS_DEBUG_LDAP_DIR
when set to a directory, enables logging of LDAP calls to a file named GsLDAPDebug_pid.log
If you enable GS_DEBUG_LDAP_DIR, GS_DEBUG_LDAP has no effect.
Note that GS_DEBUG_LDAP_DIR redacts sensitive information, but GS_DEBUG_LDAP does not.
The following exceptions have been added:
RT_ERR_STEP_St 6023
Single-step breakpoint signalled to Smalltalk.
RT_ERR_CODE_BREAKPOINT_St 6024
Method breakpoint signalled to Smalltalk.
RT_ERR_STACK_BREAKPOINT_St 6025
Stack breakpoint signalled to Smalltalk.
The SshSocketError class, associated with the new feature Support for ssh and sftp using OpenSSL, was added to support the error ERR_SshSocketError 2759. ERR_SshSocketError was present, but reserved, in previous releases.
The error GcFinalizeNotification, which is private to GemStone internals, has been added; it is used in finalization of Ephemerons.
The CannotReturn error returned true for isResumable, although this error could not actually be resumed. (#49677)
Previously, GemStone provided it’s own strings to describe errors that orginate from the OS, for example, "ENOENT, The file or directory specified cannot be found".
Now, the wording provided by the OS (on Unix) is used, which may be different; for example, "No such file or directory".
This error number is now associated with the class NumericError.
The following method has been added:
AbstractException >> signalToGci
Receiver is signaled and it will not be trappable by any exception handler. An Error will be return to the GCI.
To aid in analysis of GCI protocol errors, recent GCI call history is now automatically printed to the gem log when a GCI protocol error occurs. GCI call trace records are maintained in a wraparound buffer, and the most recent 100 records will be printed to the log.
The startstone, stopstone, stopnetldi, and waitstone utilities have been tuned and optimized for modern hardware, and require much less overhead time than in previous releases. In practice, the amount of startstone performance improvement will depend on the specific startstone tasks for an application.
These utilities now support new rules for resolving configuration files, as described in Section 2.6 .
Some corner cases of behavior in the non-E handling have been cleaned up.
The documentation in the System Administration Guide has been extensively revised and expanded.
It is allowed to make a copy of any of the gemnetobject scripts and edit to add your desired behavior.
Previously, it was documented that the custom gemnetobject would be found in the home directory of the current user. However, the code was incorrectly looking in the startup directory of the NetLDI. This behavior has been removed.
When using a configuration file as an argument to largememorypages, the configuration file must have large pages enabled. If SHR_PAGE_CACHE_LARGE_MEMORY_PAGE_POLICY is not enabled in a -z or -e argument, the largemememorypages output includes cache configuration information, but no large page size recommendations.
In addition, the -p or SHR_PAGE_CACHE_LARGE_MEMORY_PAGE_SIZE_MB in a -z or -e argument no longer defaults; you must now specified the page size on Linux and AIX.
The secure_backup_extract utility provides a way to verify the signature of a secure backup, that can be used on secure backup files from any earlier version (the secure backup feature was added in v3.4), without requiring a GemStone environment. This utility is available on little-endian hosts only (Linux and Mac).
secure_backup_extract (sig | cert) secureBackupFile outputFile
where:
sig - extract the digital signature and write to outputFile
cert - extract the public signing key and write to
outputFile
secureBackupFile - a valid GemStone secure backup
outputFile - location to write script results; this file
must not already exist
secure_backup_extract extracts the public signing cert or the digital signature from a secure backup file, and writes it to a new file. While $GEMSTONE is not needed, you must have openssl and perl available.
This script produces the same result as copydbf, using copydbf -X to extract the public signing cert, or copydbf -Y to extract the digital signature. To verify the digital signature, compare the binary files using the unix utility cmp.
For example, if you have a secure backup file backup.sdbf that was signed using GemStone's example private cert backup_sign_2_clientkey.pem, either of the following will extract the public signing cert:
secure_backup_extract cert backup.sdbf signingCert.secbkext
copydbf -X signingCert.copydbf backup.sdbf
This can be compared with each other, or against the signing cert used to make the backup; for example:
cmp -l signingCert.secbkext $GEMSTONE/examples/openssl/certs/backup_sign_2_clientcert.pem
To extract the digital signature itself:
secure_backup_extract sig backup.sdbf digitalSig.secbkext
copydbf -Y digitalSig.copydbf backup.sdbf
which can be compared for validation:
cmp -l digitalSig.secbkext digitalSig.copydbf
Regardless of the Comparison Mode of the repository, topaz’s default fileformat is now utf8. This ensures files will be written to disk in UTF-8 encoding.
Files generated from GemStone will include an explicit fileformat command. If you are filing in files with the old 8-bit encoding, ensure the headers include fileformat 8bit, or execute this command prior to filein.
The topaz debuggem command allows you to attach topaz to an executing process for debugging. v3.7 has new features that make this easier.
The added method System class >> waitForDebug enables GEM_LISTEN_FOR_DEBUG; it is not necessary to use the configuration parameter, nor to invoke listenForDebugConnection. It then immediately waits, so another session can attach. When using this method, the debuggem command is the same, but there is no need to perform the stack set in the debugging session, as was necessary when using topazwaitfordebug.
KILL
In the debugging topaz session (the session created by debuggem), execute a kill -TERM against the executing gem or topaz -l (the session being debugged).
DETACH
In the debugging topaz session (the session created by debuggem), executes System cancelWaitForDebug and logs out. The GsProcess being debugged will be continued after the logout, and System class >> waitForDebug will return to the caller.
RESUME
In the debugging topaz session (the session created by debuggem), executes System cancelWaitForDebug and logs out. The GsProcess being debugged will be continued after the logout, and System class >> waitForDebug will return to the caller.
A option has been added to support the one-time password feature (One-time Password).
set onetimepassword onOrOff
Determines if the password is a normal GemStone password or a special one-time password. When OFF, the default, the password field is interpreted as a normal GemStone password.When ON, the password field is interpreted as a onetime password.
The following obsolete and nonfunctional parameters have been removed:
The following legacy parameters have also been removed; applications should use the parameter STN_CACHE_WARMER_ARGS for automatic cache warming on startup.
Previously, a setting of 0 disabled native code, 1 enabled native code, and 2 enabled native code with inlining some math primitives.
Now, there are only two settings: 0 to disable native code, and 2 to enable native code. A setting of 1 is reserved for future use, but is legal to use and interpreted as a 2 to enable native code.
The default setting for this parameter was previously 2 to specify 2MB large pages, although a value of 0 was intended to specify the linux default value. Now, with no setting or a setting of 0, the system determine a default by looking at:
If there are 1GB pages configured, the value defaults to 1GB; otherwise, if there are 2MB pages configured, the value defaults to 2MB; otherwise, it will use the Linux default size in /proc/meminfo.
The default for SHR_PAGE_CACHE_SIZE_KB, when a specific value is not defined in a configuration file used by the Stone, has increased from 75MB to 200MB.
If the value of this parameter is 0, the login timeout used was previously 5 minutes, and is now 1 minute.
The number of sessions used by the Admin GcGem now may be determined using the setting for reclaim sessions, which is calculated based on the setting for STN_MAX_GC_RECLAIM_SESSIONS. See Number of threads configured for AdminGem.
The information written on cache statistics has been extensively revised and reorganized, and new Process Types added to reflect the different responsibilities of different GemStone processes or process threads. In particular, the general Pgsvr process type has been divided up into the different specific page servers (cache, free frame, AIO, etc.), and the PageManager has been divided from the Stone. A number of obsolete statistics have been removed, and new statistics have been added.
Statistics collection in the Shared Page Cache Monitor has been adjusted so expensive per-frame statistics are collected less frequently, not more than once per second, to reduce overhead for large systems.
Compressing statmonitor data with lz4 now has improved compression (between 3% and 25%) by using a C dictionary; this dictionary is in the distribution as $GEMSTONE/bin/lz4.statmon.dict.bin, and is used by VSD to read lz4-compressed statmonitor data files in VSD v5.6 and later.
Statmonitor files generated by 3.7 and compressed using lz4 can only be read using VSD v5.6 or later. VSD 5.6 can read lz4-compressed statmonitor files generated by earlier versions of GemStone, and older versions of VSD can read statmonitor files generated by GemStone v3.7 that are not compressed or that are compressed using gz.
To uncompress an lz4-compressed statmonitor data file on the command line, you must use an additional -D $GEMSTONE/bin/lz4.statmon.dict.bin argument; for example:
os$ lz4 -D $GEMSTONE/bin/lz4.statmon.dict.bin stats.out.lz4
The statmonitor -z (gzip) and -Z (lz4) compression arguments now accept an optional argument to specify the compression level. Higher levels provide greater compression, at the expense of performance.
-z accepts 1...9; the default, if no level is included, is 6.
-Z accepts 1...12; the default, if no level is included, is 3.
Several Process Types have been split up. For statistics that applied to the previous general process type, these are now associated only with the relevant process types. For example., the PageMgr* stats that were previously of type Stn, since the PageManager is a thread in the Stone, are now specifically of type PageMgrThr.
The general type Pgsvr no longer exists. It is replaced by:
StnAioThr (AIO PageServer threads in Stone)
FreeFrameThr (Free Frame PageServer threads in Stone)
GemPgsvrMain, GemPgsvrThr (Gem PageServer)
Statistics that were previously of type Pgsvr will now apply to one or more of these new types.
The PageManager has been a thread in the Stone for some number of releases, but statistics for PageManager were previously recorded under the same statistics type as the Stone. Now, the PageManager has its own Type, PageMgrThr.
Note that since the PageManager is a thread, not a process, host process stats are not collected for the PageManager. To see host process stats, you must look at the Stone’s statistics.
The restore threads used during restoreFromBackup have also been made a new process type, RestoreThr.
For threads within the Gem, the GemThr type has been added, to distinguish from the Gem type. Host system stats are not collected for GemThr.
A new method has been added to list statistics that apply to Gem threads:
System class >> cacheStatisticsDescriptionForGemThreads
Returns an Array of Strings describing cache statistics applicable to threads started by gems for certain repository-wide operations such as markForCollection, full backup, etc.
System class >> cacheStatisticsDescriptionForPageManager
Returns an Array of Strings describing cache statistics applicable to the stone's page manager thread.
System class >> pageManagerCacheStatistics
Return the cache statistics for the page manager thread if this session is located on the same host as the stone process. Only cache statistics applicable to the page manager thread are returned.
System class >> pageManagerCacheStatisticWithName: aString
Return the value of the cache stat with the given name, which must match an element of the Array returned by the #cacheStatisticsDescription method applicable to the page manager thread. The UserTime and SysTime statistics cannot be accessed using this method.
System class >> pageManagerProcessSlot
Answer the cache slot for the page manager thread or -1 if the slot was not found. A page manager exists only on the shared page cache used by the stone process.
The existing statistics to capture memory use on Linux did not reliably capture important information, and in many cases were misleading.
Now, on Linux, statmonitor collects memory use related statistics from /proc/<pid>/smaps instead of /proc/<pid>/maps.
There is some performance impact, since it is more expensive to read smaps than maps, particularly on large systems with many processes and short sampling intervals. A new thread in statmonitor is dedicated to reading smaps; this thread is designed to consume a upper maximum of 25% of 1 core, although it will normally take less; much less on smaller systems.
The following per-process statistics have been removed:
The following are the new per-process statistics. Note that these are only collected for the main thread within the Gem.
PrivateClean (All)
The amount of memory in kilobytes mapped to the process which has not been modified since it was mapped.
PrivateDirty (All)
The amount of memory in kilobytes mapped to the process which has been modified since it was mapped.
PSSSize (All)
The proportional set size of the process in kilobytes. PSS includes memory counted in PrivateClean and PrivateDirty as well as a portion of the memory shared by this process and with one or more other processes.
Swap (All)
The amount of memory in kilobytes used by this process which has been swapped out to disk.
SwapPss (All)
The amount of memory in kilobytes swapped out to disk. SwapPss includes memory counted in Swap as well as a portion of the memory swapped out which is shared by this process and with one or more other processes.
MemMapRegions (CachePgsvr Gem GemPgsvrMain Linux_Process Netldi Shrpc Statmon Stn)
The number of memory mapped regions the process is using.
The following statistics allow monitoring performance of the new statmonitor smaps thread itself.
SmapsCollectCount (Linux System)
Number of times the statmonitor smaps thread has collected smaps statistics for all processes it is monitoring.
SmapsLastActualSleepTime (Linux System)
The number of real milliseconds the statmonitor smaps thread actually slept in its most recent sleep.
SmapsLastReqSleepTime (Linux System)
The number of real milliseconds the statmonitor smaps thread requested to sleep in its most recent sleep.
SmapsLastTimeCollectingStats (Linux System)
The number of real microseconds the statmonitor smaps thread spent collecting smaps statistics for all monitored processes for its most recent sample.
SmapsPidsMonitoredCount (Linux System)
The number of processes the statmonitor smaps thread is currently monitoring.
SmapsProcFileFailedReads (Linux System)
Number of times the statmonitor smaps thread received an error when attempting to read the smaps file for a process. Usually indicates the process has exited.
SmapsSharedTableBuckets (Linux System)
Number of collision buckets present in the smaps shared process id table.
SmapsSharedTableSize (Linux System)
Number of keys present in the smaps shared process id table.
Access to /proc/pid/smaps is restricted. Statmonitor and gem primitives which collect per-process statistics cannot collect smaps statistics for processes owned by other users. Attempting to collect the smaps statistics does not raise an error, but the values for those specific statistics will always be zero (all other statistics will show up normally for other users).
When running with the NetLDI in guest mode with captive account, each gem process is owned by this account, and thus each Gem has programmatic access to the statistics for other users. As long as statmonitor is executed as the captive account user, and this account is the same account as started the Stone, statmonitor can collect these memory statistics for all processes.
When running the Stone and NetLDI owned by root with the s bit set, Gem processes are owned by the account logging in. In this case, statmonitor requires additional configuration to be able to read these memory statistics.
os$ setcap cap_sys_ptrace=pe $GEMSTONE/bin/statmonitor
os$ cd $GEMSTONE/sys
os$ chown root $GEMSTONE/bin/statmonitor
os$chmod u+s $GEMSTONE/bin/statmonitor
Cache statistics are most commonly recorded by statmonitor. However, you may collect cache statistics programmatically; including host statistics, using methods such as System hostStatisticsForProcess:.
With the NetLDI owned by root with the s bit set (authenticated mode), Gems processes run as the unix userid that is logging in; and Gems will not be able to read the smaps memory statistics for Gems that are logged as a different unix user.
For security reasons, it is not recommended to give all Gem processes the cap_sys_ptrace capability; and setting this capability prevents gdb attaching, so pstack and kill -USR cannot write C stack traces. If a Gem must programmatically monitor the memory statistics for other Gem processes, you should configure the monitor Gem to run with a different gem executable than standard Gems in your environment, and give this gem executable the required capability.
1. Make a copy of $GEMSTONE/sys/gem for an RPC Gem, or $GEMSTONE/bin/topaz if this process will run as linked topaz. For example:
os$ cp $GEMSTONE/sys/gem $GEMSTONE/sys/gemTrace
os$ cp $GEMSTONE/bin/topaz $GEMSTONE/bin/topazTrace
2. Give this copy the cap_sys_ptrace capability.
os$ setcap cap_sys_ptrace=pe $GEMSTONE/bin/topazTrace
os$ setcap cap_sys_ptrace=pe $GEMSTONE/sys/gemTrace
3. For an RPC gem, create a custom gemnetobject, and use this for login.
os$ cp $GEMSTONE/sys/gemnetobject $GEMSTONE/sys/gemnetobject_trace
Edit your custom gemnetobject, for example gemnetobject_trace, to set the gemname that invokes this executable, by modifying this line:
gemname="gemTrace"
Login using your custom gemnetobject in the login parameters:
topaz> set gemnetid gemnetobject_trace
4. If you are running NetLDI with the startnetldi -n option, you must also add an entry to the services.dat file. See theSystem Administration Guide, Appendix A, for more details.
These statistics report numeric values that represent internal state. These have been verified and the statistics definition updated for 3.7.
GarbageCollectionState (Gem)
Indicates the phase of a garbage collection task or other multi-threaded operation. Values are defined as follows:
4 - Scan Shadowed (scavengable) Data Pages
9 - Rescan Shadowed Pages (for listRefToInstOfClasses)
13 - Audit Rescan Object Table (rescan to find references to non existent objects)
18 - Find Connected Objects Sweep
GcLockKind (Gem)
Indicates the state of the garbage collection lock and why it is being held:
Previously, ReposAtMaxSize was a boolean. Now, it is an integer indicating the current state of the extents:
0 - extents are not at maximum configured size and not in a disk full state.
1 - all extents have file system full state.
2 - all extents are currently at their configured size limit.
As described here, the GcLock can be held by up to five sessions, which makes existing protocol misleading.
SessionWithGcLock has been removed, replaced by the following statistic:
SessionsWithGcLock
Number of sessions holding a GcLock or repository Scan lock
The Stone’s statistics no longer include GcLockKind. GcLockKind is now a per-session stat, describing the kind of lock that this session is holding.
The following statistics have been removed (in addition to Linux per-process stats listed above, and SessionWithGcLock):
The following statistics provide the time since a particular event occurred; this avoids the need to manually determine the delta between a given timestamp and the event timestamp. 0 means the event just occurred, -1 means the event has not occurred in the lifetime of the process.
SecondsSinceAbort (Gem Stn)
Stone: number of seconds since any session has aborted. Gem: number of seconds since this session has aborted.
SecondsSinceCheckpoint (Stn)
Number of seconds since a checkpoint was started.
SecondsSinceCommit (Gem Stn)
Stone: number of seconds since any session has committed. Gem: number of seconds since this session has committed.
SecondsSinceCrDisposal (Stn)
Number of seconds since a commit record was disposed.
SecondsSinceExtentGrow (Stn)
Number of seconds since any extent was grown.
SecondsSinceFailedCommit (Gem Stn)
Stone: number of seconds since any session attempted a commit which ultimately failed.
Gem: number of seconds since this session attempted a commit which ultimately failed.
SecondsSinceLogin (Gem Stn)
Stone: number of seconds since any session logged in.
Gem: number of seconds since this session logged in.
SecondsSinceLogout (Stn)
Number of seconds since any session logged out.
SecondsSinceLowFreespace (Stn)
Number of seconds since repository low free space was detected.
SecondsSinceNewTranlog (Stn)
Number of seconds since a new tranlog was started.
SecondsSinceReclaim (Stn)
Number of seconds since a reclaim gem committed.
SecondsSinceReclaimDead (Stn)
Number of seconds since a reclaim gem committed and reclaimed object identifiers.
SecondsSinceSigAbort (Gem)
Number of seconds since the session detected a SigAbort.
SecondsSinceSigLostOt (Gem)
Number of seconds since the session detected a SigLostOtRoot.
SecondsSinceStartLongPrim (Gem)
Number of seconds since the session started a long primitive operation.
SecondsSinceStartStone (Stn)
Number of seconds since the stone has been available for logins.
SecondsSinceTranlogFull (Stn)
Number of seconds since the a tranlog full condition was detected.
BitmapPagesPreempted (CachePgsvr FreeFrameThr PageMgrThr)
Number of bitmap pages removed from the cache by the process.
BitmapPageWrites (StnAioThr)
Number of bitmap pages written to disk by the process.
CacheIdle (Shrpc)
A boolean indicating if the shared page cache is idle.
CachePgsvrRemoveFrameId (CachePgsvr)
The frameId that the cache page server is attempting to recycle.
CachePgsvrRemovePageId (CachePgsvr)
The pageId that the cache page server is attempting to remove from the remote shared page cache.
CacheRegionNumFrames (FreeFrameThr StnAioThr)
Number of frames in the cache region for the process.
CommitRecordPagesPreempted (CachePgsvr FreeFrameThr PageMgrThr)
Number of commit record pages removed from the cache by the process.
CommitRecordPageWrites (StnAioThr)
Number of commit record pages written to disk by the process.
DataPagesPreempted (CachePgsvr FreeFrameThr PageMgrThr)
Number of data pages removed from the cache by the process.
DataPageWrites (StnAioThr)
Number of data pages written to disk by the process.
FfiGcHeapBytes (Gem)
Bytes allocated by CByteArray class >> gcMalloc: and other C data allocations for instances of GsSocket, etc, and not yet freed by in-memory GC.
FfiHeapBytes (Gem)
Cumulative bytes allocated by CByteArray class >> malloc:, that the VM GC will not free, not decremented when application FFI code calls free.
FreeFrameListOkLimit (FreeFrameThr StnAioThr)
The ok free frame limit for the process.
FreeFrameLowerLimit (FreeFrameThr StnAioThr)
The lower free frame limit for the process. When the number of free frames is below this value, the process will aggressively add frames to the free list (free frame threads) or write dirty pages to disk (Aio threads).
FreeFrameUpperLimit (FreeFrameThr StnAioThr)
The upper free frame limit for the process.
GemThreadsInCacheCount (Shrpc)
The number secondary gem threads currently attached to the cache.
LowFreespaceCount (Stn)
Number of times stone detected a low free space condition.
NumInSecurityDataQueue (Stn)
Number of sessions waiting for SymbolGem to update security data of their UserProfile.
ObjectTablePagesPreempted (CachePgsvr FreeFrameThr PageMgrThr)
Number of object table pages removed from the cache by the process.
ObjectTablePageWrites (StnAioThr)
Number of object table pages written to disk by the process.
OnetimePasswordsActive (Stn)
Number of onetime passwords in the stone's hash map.
OnetimePasswordsCreated (Gem)
Number of onetime passwords this session has created.
OnetimePasswordsExpired (Stn)
Number of expired onetime passwords automatically removed by stone.
OnetimePasswordsNotValidated (Stn)
Number of failed onetime password validations.
OnetimePasswordsTotal (Stn)
Number of onetime passwords ever created by any session since the stone was started.
OnetimePasswordsValidated (Stn)
Number of successful onetime password validations.
OnetimePasswordUsed (Gem)
A boolean with value 1 if the session used a onetime password to login, otherwise 0.
OtherPagesPreempted (CachePgsvr FreeFrameThr PageMgrThr)
Number of pages removed from the cache by the process that were not object table, data, commit record, or bitmap pages.
OtherPageWrites (StnAioThr)
The number of pages written by the process that were not object table, data, commit record or bitmap pages since the process was started.
RecovNumPendingCheckpoints (Stn)
Number of checkpoints pending replay from the tranlog during recovery.
RecovSkippedCheckpointCount (Stn)
Number of checkpoints skipped during recovery.
RecovTimeWaitingForCheckpoints (Stn)
Total amount of real milliseconds the stone recovery thread spent waiting for checkpoints.
ScanLimitNumFrames (FreeFrameThr StnAioThr)
Maximum number of cache frames scanned by the process before sleeping.
TimeInCheckpoint (Stn)
Cumulative number of real seconds the stone has spent writing checkpoints.
TimeInLowFreespace (Stn)
Cumulative number of real seconds the stone has spent in low free space mode.
TranlogFullCount (Stn)
Number of times stone detected a tranlog full condition.
TteCrPageInUse (Stn)
Number of commit record page entries in use in stone's internal commit record cache.