ydb_env_set returns non-zero status on MUPIP CREATE errors
Final Release Note
When MUPIP CREATE reports errors, sourcing ydb_env_set
returns a non-zero status to the shell, and reports the location of the MUPIP CREATE error output. It also forces NOASYNCIO in gdedefaults
as the default database block size of 2048 bytes is incompatible with ASYNCIO in filesystems with 4096 byte blocks. Previously, it silently ignored MUPIP CREATE errors and reported a zero status. This issue was only encountered in our development and test environment, and was never reported by a user. [#945 (closed)]
Description
This is an issue I noticed while working on YDBTest#365 (closed) and analyzing the r124/ydb197
subtest failure after my changes to the YDBTest test framework to randomly enables ASYNCIO. The test creates a 1-region database with AIO
setting turned on in the DEFAULT segment (change -segment DEFAULT -asyncio
command below) and enabled in the TEMPLATE
section too (template -segment -asyncio
command below). After calling ydb_env_set
, a later call to dbcheck.csh
fails because the YDBOCTO
region database file does not exist.
Below is a simple test case that reproduces the issue. The below sets up a clean environment in /tmp/scratchdir
.
bash
cd /tmp
rm -rf scratchdir
mkdir scratchdir
cd scratchdir
export ydb_dir=.
unset ydb_gbldir gtmgbldir
unset ydb_chset gtm_chset
export LC_ALL=C
export ydb_gbldir=yottadb.gld
cat > inp.gde << CAT_EOF
change -segment DEFAULT -asyncio
template -segment -asyncio
CAT_EOF
$ydb_dist/yottadb -run GDE @inp.gde
$ydb_dist/mupip create
. $ydb_dist/ydb_env_set
echo $?
The above commands run fine without any errors. The last command returns a value of 0 indicating ydb_env_set
ran fine.
And then I run the following command in the same terminal.
$ $ydb_dist/mupip integ -reg "*"
%YDB-I-REGFILENOTFOUND, Database file %ydbocto.dat corresponding to region YDBOCTO cannot be found
%SYSTEM-E-ENO2, No such file or directory
%YDB-E-NOREGION, REGION not found: YDBOCTO
Integ of region DEFAULT
%YDB-E-DBFILERR, Error with database file /tmp/scratchdir/mumps.dat
%SYSTEM-E-ENO22, Invalid argument
%YDB-W-MUNOTALLINTEG, At least one region skipped. See the earlier messages
There are 3 issues that need to be fixed.
- The
YDBOCTO
region did not get created. - The
DEFAULT
region gets an %SYSTEM-E-ENO22` error. -
ydb_env_set
encountered errors while creating theYDBOCTO
region but returned a 0 exit status which is not right.
Draft Release Note
When MUPIP CREATE reports errors, sourcing ydb_env_set
returns a non-zero status to the shell, and reports the location of the MUPIP CREATE error output. It also forces NOASYNCIO in gdedefaults
as the default database block size of 2048 bytes is incompatible with ASYNCIO in filesystems with 4096 byte blocks. Previously, it silently ignored MUPIP CREATE errors and reported a zero status. [#945 (closed)]