YottaDB / YDB

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

[#312] Various issues with GTM-8182 changes (to support multiple replication instances) in V6.3-003 #320

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

Various issues were identified during a code review of the GTM-8182 enhancement (in GT.M V6.3-003).

1) REPLINSTMISMTCH error gets issued incorrectly when updates are done to multiple instances using extended references. 2) A fatal GTMASSERT2 error is issued incorrectly in some cases. 3) A fatal SIG-11 (aka KILLBYSIGSINFO1/SIGMAPERR) error is issued incorrectly in some cases. In fact, this does not even require multiple instances. Just one replication instance is enough. 4) An error in a database file turns instance freeze ON in the wrong instance in some cases. 5) Repeatedly using PEEKBYNAME on the journal pool when the latter is not up causes a memory leak. 6) A process incorrectly attaches a database region to an instance file at the first access to the region instead of at the first update to the region when gtm_custom_errors is not defined.

These issues are tested in the r124 test (subtests named ydb312_*). See those tests for a more detailed description of the actual use case.

The following code cleanup was first done.

Now that all this cleanup is done, it was straightforward (though not trivial) to fix the 6 issues described above. The core of the changes is done in the following modules

A lot of the logic in the above modules has been reworked/simplified as a result. Additionally, the reworked changes continue to ensure that if multiple gld files point to the same replication instance file, each of those gld files continue to point to only one journal pool i.e. only one shmat() call to journal pool is done.