# PN5_60902

Updated: 1/18/2022, 5:31:44 PM
Created: 1/18/2022, 5:31:44 PM
Last Updated By: dependabot[bot]
Read Time: 2 minute(s)

# Description

Distributed Files: Add new error messages to enable failures to be better reported

# Previous Release Behavior

Some errors with distributed files were difficult to find, and some were silent.

# Current Release Behavior

This change gives more informed messages to 2 errors with distributed files.

# (1) Missing part file

If one of the part files is missing, you wouldn't get an error, it would just fail. The following shows the new behaviour.

First, create a file like this ... In this file, we create parts 1 and parts 3 , but NOT part 2

[[email protected]:~/tmp4]$ create-file DISTR TYPE=DISTRIB
[ 417 ] File DISTR]D created , type = J4
[ 417 ] File DISTR created , type = DISTRIB
[[email protected]:~/tmp4]$ create-file DISTR-PART1
[ 417 ] File DISTR-PART1]D created , type = JD
[ 417 ] File DISTR-PART1 created , type = JD
[[email protected]:~/tmp4]$ create-file DISTR-PART3
[ 417 ] File DISTR-PART3]D created , type = JD
[ 417 ] File DISTR-PART3 created , type = JD
[[email protected]:~/tmp4]$ create-distrib -a DISTR 1 DISTR-PART1
Part file 'DISTR-PART1', Part number 1 added
[[email protected]:~/tmp4]$ create-distrib -a DISTR 3 DISTR-PART3
Part file 'DISTR-PART3', Part number 3 added
1
2
3
4
5
6
7
8
9
10
11
12
13

We can now safely create an item in part 1 and part3. BUT if we create an item in part2, unpredictable things occur as in this example

[[email protected]:~/tmp4]$ ED DISTR 2-2
2-2
TOP
.i
001+hello world
002+
.fi
Record '2-2' written to file 'DISTR'
[[email protected]:~/tmp4]$ ED DISTR 2-2
2-2
TOP
.p
TOP
001 ...............................................................
BOTTOM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Other unpredictable behaviour includes segmentation violations.

Now, with the change, an error is generated and the 'errmsg' program enhanced to show all error message.

[[email protected]:~/tmp4]$ ED DISTR 2-2

Error 2021 during READ_ERROR to file ./DISTR
Enter I to Ignore, R to Retry , Q to Quit : q
[[email protected]:~/tmp4]$
[[email protected]:~/tmp4]$ errmsg 2021
Error 2021: Distributed Files: Item Id generates part number which has no associated file
[[email protected]:~/tmp4]$
1
2
3
4
5
6
7
8

# (2) A malformed item id generates an error

The default partition algorithm assumes a particular format, as in "nn-nn". If this format is not kept, we now give a meaningful error message

[[email protected]:~/tmp4]$ ED DISTR ABC

Error 2020 during READ_ERROR to file ./DISTR
Enter I to Ignore, R to Retry , Q to Quit : q
[[email protected]:~/tmp4]$ errmsg 2020
Error 2020: Distributed Files: Item Id malformed and cannot create part number
[[email protected]:~/tmp4]$
1
2
3
4
5
6
7

# Notes

In both examples, we've used the ED command to show the error. Inside a jBC application, you can use the ON ERROR clause to return the error to the application rather than giving an error message to the screen

Back to 5.7.4 Release Notes