YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

Epoch tapering works correctly without process termination from signal 8 in a rare case #247

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

Final Release Note

Epoch tapering works correctly. Previously, on very rare occasions, epoch tapering could result in process termination with a signal 8 resulting from a divide-by-zero error. This issue was only observed in the development environment, and was never reported by a user. (#247)

Description

There was a test failure in internal testing where a mumps process terminated with the following divide-by-zero exception.

%YDB-F-KILLBYSIGSINFO1, YottaDB process 27639 has been killed by a signal 8 at address 0xB5F7E45C (vaddr 0x00006BF7)

After some analysis, this turns out to be a longstanding edge case with the epoch tapering logic. In the below MAX calculation, it is possible CNL->epoch_taper_start_dbuffs is > 1 when the MAX macro does the if (a>b) check but before it returns the second parameter, CNL->epoch_taper_start_dbuffs could be concurrently set to 0 by another process executing the same EPOCH_TAPER_IF_NEEDED macro but going through the else block (instead of the if block).

1015                 tmp_epoch_taper_start_dbuffs = MAX(1,CNL->epoch_taper_start_dbuffs); /* stable value for all calculations */    \

Draft Release Note

Epoch tapering works correctly. Previously, on very rare occasions, epoch tapering could encounter a divide-by-zero error. This issue was only observed in the YottaDB development environment, and was never reported by a user.