Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New r124/ydb312_gtm8182g subtest (tests YottaDB/YottaDB#312 in r1.24) #341

Merged
merged 5 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions r124/inref/ydb312gtm8182g.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. ;
; All rights reserved. ;
; ;
; This source code contains the intellectual property ;
; of its copyright holder(s), and is made available ;
; under a license. If you do not know the terms of ;
; the license, please stop and do not read further. ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

ydb312gtm8182g

DO getPaths

WRITE !

WRITE " Before updates: ",!
WRITE " ----------------: ",!
DO numProc
DO ftok
WRITE !

WRITE " Updating through GBL1.gld",!
SET $ZGBLDIR=GBL1path
SET ^Protagonist="Hamilton"
WRITE " Updating through GBL2.gld",!
SET $ZGBLDIR=GBL2path
SET ^Antagonist="Burr"
WRITE !

WRITE " After updates: ",!
WRITE " ----------------: ",!
DO numProc
DO ftok
WRITE !

quit

getPaths

SET INST1path=$ZTRNLNM("path_INST1")
SET INST1gbldir=INST1path_"/mumps.gld"

SET GBL1path=INST1path_"/GBL1.gld"
SET GBL2path=INST1path_"/GBL2.gld"

quit

numProc
WRITE " Number of processes attached to journal pool of mumps.repl: "

ZSYSTEM "$ydb_dist/mupip ftok -jnlpool mumps.repl |& $grep mumps.repl | $tst_awk '{print $6}' >& shm1.out ; ipcs -a | $grep `cat ./shm1.out` | $tst_awk '{print $NF}'"

quit

ftok
WRITE " "

ZSYSTEM "set repl_ftok_semid = `$gtm_dist/ftok -id=44 $gtm_repl_instance | awk '{print $5}'` ; $gtm_dist/semstat2 `ipcs -s | grep $repl_ftok_semid | awk '{print $2}'` | grep 'sem 1' | sed 's/sem 1/JNLPOOL ftok : '$gtm_repl_instance' /g' "

2 changes: 2 additions & 0 deletions r124/instream.csh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# ydb312_gtm8182d [jake] Tests that opening the jnlpool as part of an update works fine after unsuccessfully opening the jnlpool as part of a read
# ydb312_gtm8182e [jake] Tests a fix for an incorrect GTMASSERT2 error when [gtm/ydb]_repl_instance env vars are unset and an instance has no repl file mapping
# ydb312_gtm8182f [jake] Tests a fix for an incorrectly issued REPLINSTMISMTCH error in a LOCK command with extended references in a process that accesses multiple instances
# ydb312_gtm8182g [jake] Tests that updating DB1, in GLD1, and DB2, in GLD2, will only attach to the journal pool once when DB1/2 are both within GLD3 ( associate with a replicating source server)
# ydb315 [jake] Tests that the ZCOMPILE operation will not display warning if $ZCOMPILE contains "-nowarnings"
#----------------------------------------------------------------------------------------------------------------------------------------------------------

Expand All @@ -37,6 +38,7 @@ setenv subtest_list_non_replic ""
setenv subtest_list_non_replic "$subtest_list_non_replic readonly ydb275socketpass ydb280socketwait jnlunxpcterr ydb297 ydb315"
setenv subtest_list_replic ""
setenv subtest_list_replic "$subtest_list_replic ydb282srcsrvrerr ydb293 ydb312_gtm8182a ydb312_gtm8182b ydb312_gtm8182d ydb312_gtm8182e ydb312_gtm8182f"
setenv subtest_list_replic "$subtest_list_replic ydb312_gtm8182g"

if ($?test_replic == 1) then
setenv subtest_list "$subtest_list_common $subtest_list_replic"
Expand Down
1 change: 1 addition & 0 deletions r124/outref/outref.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ PASS from ydb312_gtm8182b
PASS from ydb312_gtm8182d
PASS from ydb312_gtm8182e
PASS from ydb312_gtm8182f
PASS from ydb312_gtm8182g
##ALLOW_OUTPUT NON_REPLIC
r124 test DONE.
36 changes: 36 additions & 0 deletions r124/outref/ydb312_gtm8182g.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Create the DB


# GBL1.gld is created to point to mumps.dat and mumps.repl

# GBL2.gld is created to point to a.dat and mumps.repl

# Change back to original global directory

# Start INST1 INST2 replication with mumps.gld as $zgbldir
==Executing MULTISITE_REPLIC 'START INST1 INST2'==
Starting Primary Source Server in ##TEST_PATH##
Starting Passive Source Server and Receiver Server in ##FILTERED##_REMOTE_TEST_PATH_/instance2

# Run ydb312gtm8182g.m to update DB through GBL1.gld and GBL2.gld

Before updates:
----------------:
Number of processes attached to journal pool of mumps.repl: 1
##TEST_AWK JNLPOOL ftok : mumps.repl : \(semval=1, semncnt=0, semzcnt=0, sempid=[0-9]*\)

Updating through GBL1.gld
Updating through GBL2.gld

After updates:
----------------:
Number of processes attached to journal pool of mumps.repl: 2
##TEST_AWK JNLPOOL ftok : mumps.repl : \(semval=2, semncnt=0, semzcnt=0, sempid=[0-9]*\)


# Write variables to the screen from mumps.gld
# ^Protagonist: Hamilton
# ^Antagonist : Burr

# Check and shutdown the DB
DB has shutdown gracefully
69 changes: 69 additions & 0 deletions r124/u_inref/ydb312_gtm8182g.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/local/bin/tcsh -f
#################################################################
# #
# Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
#
setenv gtm_repl_instance "mumps.repl"
unsetenv gtm_db_counter_sem_incr # avoid semaphore counter overflow otherwise they inflate semval which affects the reference file

$MULTISITE_REPLIC_PREPARE 2

echo "# Create the DB"
$gtm_tst/com/dbcreate.csh mumps 2 -gld_has_db_fullpath >>& dbcreate.out
if ($status) then
echo "DB Create Failed, Output Below"
cat dbcreate.out
exit -1
endif
echo ""
echo ""

echo "# GBL1.gld is created to point to mumps.dat and mumps.repl"
setenv gtmgbldir "GBL1"
$GDE CHANGE -SEGMENT DEFAULT -FILE=mumps.dat >& gde_change1.txt
echo ""

echo "# GBL2.gld is created to point to a.dat and mumps.repl"
setenv gtmgbldir "GBL2"
$GDE CHANGE -SEGMENT DEFAULT -FILE=a.dat >& gde_change2.txt
echo ""

echo "# Change back to original global directory"
setenv gtmgbldir "mumps"
echo ""

echo '# Start INST1 INST2 replication with mumps.gld as $zgbldir'
$MSR START INST1 INST2
echo ""

setenv path_INST1 `$tst_awk '{-F " "; if ($1" "$2 ~ /INST1 DBDIR/) print $3}' $tst_working_dir/msr_instance_config.txt`

echo "# Run ydb312gtm8182g.m to update DB through GBL1.gld and GBL2.gld"
$gtm_dist/mumps -run ydb312gtm8182g
echo ""

echo "# Write variables to the screen from mumps.gld"
echo -n "# ^Protagonist: "
$ydb_dist/mumps -run ^%XCMD 'WRITE ^Protagonist,!'
echo -n "# ^Antagonist : "
$ydb_dist/mumps -run ^%XCMD 'WRITE ^Antagonist,!'
echo ""


echo "# Check and shutdown the DB"
$gtm_tst/com/dbcheck.csh >>& check.out
if ($status) then
echo "DB Check Failed, Output Below"
cat check.out
exit -1
endif
echo "DB has shutdown gracefully"