Changing database number of allocated locks.

85 views
Skip to first unread message

kdtop

unread,
Jan 30, 2023, 2:09:59 PMJan 30
to
Hey all, this is a cross post from a thread here on the Hardhats forum: https://groups.google.com/g/hardhats/c/Bn3omDpBWy8

That thread was partly about discovering that I don't have enough locks allocated. I have tried to change my number of locks, but I am having an issue, and I think the problem got lost at the end of a long thread. So I will repost my problem here.
...

OK, I had to wait until I had time to work on this and we had a FULL DATABASE BACKUP.

Here is my output

//=============================================

kdt@zz:~$ sh runAV

YottaDB VistA Startup Script
---Starting Setup_env script---
vista_home=/opt/worldvista/EHR
gtm_dist=/opt/worldvista/EHR/m
---Done with Setup_env script---
Entering YottaDB system now...

yottadb>do ^GDE
%GDE-I-LOADGD, Loading Global Directory file
/opt/worldvista/EHR/g/mumps.gld
%GDE-I-VERIFY, Verification OK


GDE> change -segment DEFAULT -file="$vista_home/g/mumps.dat" -lock_space=1000
GDE> show -all

*** TEMPLATES ***
Std Inst
Def Rec Key Null Null Freeze Qdb Epoch LOCK
Region Coll Size Size Subs Coll Jnl on Err Rndwn Taper AutoDB Stats Crit
----------------------------------------------------------------------------------------------------------------------
<default> 0 256 64 NEVER N N N N Y N Y Sep

Segment Active Acc Typ Block Alloc Exten Options
------------------------------------------------------------------------------
<default> * BG DYN 1024 100 100 GLOB =1024
LOCK = 40
RES = 0
ENCR = OFF
MSLT =1024
DALL = YES
AIO = OFF
<default> MM DYN 1024 100 100 DEFER
LOCK = 40
MSLT =1024
DALL = YES

*** NAMES ***
Global Region
------------------------------------------------------------------------------
* DEFAULT

*** REGIONS ***
Std Inst
Dynamic Def Rec Key Null Null Freeze Qdb Epoch LOCK
Region Segment Coll Size Size Subs Coll Jnl on Err Rndwn Taper AutoDB Stats Crit
-------------------------------------------------------------------------------------------------------------------------------------------
DEFAULT DEFAULT 0 256 64 NEVER N N N N Y N Y Sep

*** SEGMENTS ***
Segment File (def ext: .dat)Acc Typ Block Alloc Exten Options
-------------------------------------------------------------------------------------------
DEFAULT $vista_home/g/mumps.dat
BG DYN 1024 100 100 GLOB=1024
LOCK=1000
RES = 0
ENCR= OFF
MSLT=1024
DALL= YES
AIO = OFF

*** MAP ***
- - - - - - - - - - Names - - - - - - - - - -
From Up to Region / Segment / File(def ext: .dat)
--------------------------------------------------------------------------------------------------------------------------
% ... REG = DEFAULT
SEG = DEFAULT
FILE = $vista_home/g/mumps.dat
LOCAL LOCKS REG = DEFAULT
SEG = DEFAULT
FILE = $vista_home/g/mumps.dat
GDE> save
%GDE-E-KEYWRDBAD, SAVE is not a valid verb in this context

GDE> exit
%GDE-I-VERIFY, Verification OK

%GDE-I-GDUPDATE, Updating Global Directory file
/opt/worldvista/EHR/g/mumps.gld

yottadb>

yottadb>h

Leaving YottaDB, returning to Linux...

kdt@zz:~$ dse all -dump

File /opt/worldvista/EHR/g/mumps.dat
Region DEFAULT


File /opt/worldvista/EHR/g/mumps.dat
Region DEFAULT
Date/Time 29-JAN-2023 10:12:04 [$H = 66503,36724]
Access method BG Global Buffers 7000
Reserved Bytes 0 Block size (in bytes) 4096
Maximum record size 32767 Starting VBN 129
Maximum key size 510 Total blocks 0x003A19CB
Null subscripts NEVER Free blocks 0x0007654A
Standard Null Collation FALSE Free space 0x00006000
Last Record Backup 0x0000000000000001 Extension Count 20000
Last Database Backup 0x0000000004C8B6AA Number of local maps 7437
Last Bytestream Backup 0x0000000000000001 Lock space 0x00000028
In critical section 0x00000000 Timers pending 1
Cache freeze id 0x00000000 Flush timer 00:00:01:00
Freeze match 0x00000000 Flush trigger 6563
Freeze online FALSE Freeze online autorelease FALSE
Current transaction 0x00000003BBF4A1DC No. of writes/flush 7
Maximum TN 0xFFFFFFFFDFFFFFFF Certified for Upgrade to V6
Maximum TN Warn 0xFFFFFFFF5FFFFFFF Desired DB Format V6
Master Bitmap Size 64 Blocks to Upgrade 0x00000000
Create in progress FALSE Modified cache blocks 2
Reference count 4 Wait Disk 0
Journal State ON Journal Before imaging TRUE
Journal Allocation 2048 Journal Extension 100
Journal Buffer Size 2312 Journal Alignsize 4096
Journal AutoSwitchLimit 8388548 Journal Epoch Interval 300
Journal Yield Limit 8 Journal Sync IO FALSE
Journal File: /opt/worldvista/EHR/j/mumps.mjl
Mutex Hard Spin Count 128 Mutex Sleep Spin Count 128
Mutex Queue Slots 1024 KILLs in progress 0
Replication State OFF Region Seqno 0x0000000000000001
Zqgblmod Seqno 0x0000000000000000 Zqgblmod Trans 0x0000000000000000
Endian Format LITTLE Commit Wait Spin Count 16
Database file encrypted FALSE Inst Freeze on Error FALSE
Spanning Node Absent FALSE Maximum Key Size Assured FALSE
Defer allocation TRUE Spin sleep time mask 0x00000000
Async IO OFF WIP queue cache blocks 0
DB is auto-created FALSE DB shares gvstats TRUE
LOCK shares DB critical section FALSE Read Only OFF
Recover interrupted FALSE
Reorg Sleep Nanoseconds 0
kdt@zz:~$



//==============================================
Questions
1) Why does my dse output still show --> Lock space 0x00000028 (40 decimal)
2) When I do a show --all in GDE, it ouputs the following (more above). There is a 'N' under 'Jnl'. Does this mean I am not journaling?? I thought I had this turned on?

GDE> show -all

*** TEMPLATES ***
Std Inst
Def Rec Key Null Null Freeze Qdb Epoch LOCK
Region Coll Size Size Subs Coll Jnl on Err Rndwn Taper AutoDB Stats Crit
----------------------------------------------------------------------------------------------------------------------
<default> 0 256 64 NEVER N N N N Y N Y Sep


Thanks

Kevin T

K.S. Bhaskar

unread,
Jan 30, 2023, 3:11:31 PMJan 30
to
Kevin, I haven't read all the commands and output of your post, but a couple of notes:

Apropos "I don't have enough locks allocated", you didn't have enough LOCK SPACE allocated. There is no limit on the number of locks, but if there is not enough lock space allocated, lock acquisition will run like molasses.

Apropos your questions, as discussed in https://docs.yottadb.com/AdminOpsGuide/gde.html#global-directory :

"a global directory has a second purpose in addition to holding key mappings, which is to hold database characteristics for MUPIP CREATE (https://docs.yottadb.com/AdminOpsGuide/dbmgmt.html#set). While changes to the mappings take effect as soon as a process loads a new global directory, MUPIP CREATE transfers the other characteristics to the database file. Other YottaDB processes never use the global directory defined characteristics, so they always use those in the database file."

In other words, while a global directory is always used for mapping global variables to database regions and thence to files, parameters like the lock space are used by MUPIP CREATE, and if you want to change a value for an existing database file, use MUPIP SET (https://docs.yottadb.com/AdminOpsGuide/dbmgmt.html#set). If you change a value with MUPIP SET, remember to also change it in the global directory for the next time MUPIP CREATE uses that global directory to create database files.

Regards
- Bhaskar

kdtop

unread,
Jan 30, 2023, 9:16:24 PMJan 30
to
Bhaskar,

Thank you for your reply. Since I don't deal directly with the database on a regular basis, the difference between a "global directory" (I am assuming this is not a file 'directory' that stores gobals) and the database itself is not completely clear to me.

But what I think I understood you to say, is that running ^GDE just edited the directory, not the database itself. And I need to use MUPIP SET to modify an existing database file.

I'll review the admin docs you provided before actually making any changes.

Thanks again

Kevin

K.S. Bhaskar

unread,
Jan 31, 2023, 10:54:31 AMJan 31
to
The rule to remember is that for normal, routine use, global directories are like phone directories. Just like a phone directory maps people to phone numbers, global directories map global variable nodes to database files. Just like a phone directory has less common uses, like pressing leaves between the pages, a global directory has a less common use, to provide initial database parameters when creating database files.

Regards
– Bhaskar

kdtop

unread,
Feb 18, 2023, 10:16:16 PMFeb 18
to
Just for the sake of my future documentation, I did the following

1) waited until we had a full system backup, including database.
2) stopped the vista service via: sudo systemctl stop vista.service
3) established linux variables for mumps environment via . /opt/worldvista/EHR/etc/env
4)launched MUPIP and at the prompt, entered: SET -REGION DEFAULT -LOCK_SPACE=1000 then entered EXIT to leave mupip
5)restarted vista service via: sudo systemctl start vista.service
6)I ran command: dse all -dump which listed various settings for database, including "Lock space 0x000003E8" <-- hex for 1000
7)I had previously edited the global directory with commands as below. (I previously thought this was doing what MUPIP SET does).
yottadb>do ^GDE
%GDE-I-LOADGD, Loading Global Directory file
/opt/worldvista/EHR/g/mumps.gld
%GDE-I-VERIFY, Verification OK

GDE> change -segment DEFAULT -file="$vista_home/g/mumps.dat" -lock_space=1000
8) I verified that my global directory shows 1000 locks via GDE command: show -all --> it does show 1000

Thanks all

Kevin


Reply all
Reply to author
Forward
0 new messages