Skip to content

[GTM-9308] Merge V63014 fixes to sr_unix/mu_rndwn_file.c to avoid improper error from standalone MUPIP cmds with FREEZE -ONLINE

Steven Estes requested to merge estess/YDB:gtm9308 into master

This is an issue that was observed while coming up with the v63013/gtm8772ANDgtm8784 test (see YDBTest#439 (closed) and/or YDBTest#440 (closed)) for GT.M V6.3-013.

When there are no processes attached to a database and the database is frozen by an ONLINE FREEZE, the private shared memory and semaphores still exist. In this database state, any MUPIP command that requires standalone access to the database sees the shared memory and incorrectly concludes that the last process to access it crashed. And incorrectly issues a MUUSERECOV error in this scenario.

This is an issue that turns out to be fixed in GT.M V6.3-014. Pasted below is the release note of that fix (from http://tinco.pair.com/bhaskar/gtm/doc/articles/GTM_V6.3-014_Release_Notes.html#GTM-9308).

When MUPIP RUNDOWN encounters a region with an active FREEZE -ONLINE, it skips running down the region and issues an OFRZACTIVE warning message. Previously under these circumstances, MUPIP issued less appropriate messages. (GTM-9308)

The corresponding code fix was found in sr_unix/mu_rndwn_file.c.

$ git show -U1 tags/V6.3-014 sr_unix/mu_rndwn_file.c
commit e9a1c1219951720b9e1c8af3583f1e3a8dedf1bb (tag: V6.3-014)
.
.
@@ -1115,3 +1115,3 @@ boolean_t mu_rndwn_file(gd_region *reg, boolean_t standalone)
                                                LEN_AND_LIT("Overriding OPEN journal file state in shared memory"));
-                               } else
+                               } else if (!FROZEN_CHILLED(csa))
                                {       /* Journal file state being still open in shared memory implies a crashed state,
.
.

This commit picks that particular fix.

Note that this commit does not pick all the fixes in the above commit to sr_unix/mu_rndwn_file.c. That will be done as part of #779 (closed) when all the GT.M V6.3-014 code changes are merged into YottaDB.

When there are no processes attached to a database yet the database is frozen, the private shared memory and semaphores still exist. The standalone code in MUPIP sees the shared memory and concludes that the last process crashed. The one line fix just bypasses this error.

This is from GTM-9308 that was merged into V63014. The release note for that issue is here: http://tinco.pair.com/bhaskar/gtm/doc/articles/GTM_V6.3-014_Release_Notes.html#GTM-9308

Note this fix is tested by the v63013/gtm8772ANDgtm8784 subtest as this subtest does not run correctly without this fix.

Edited by Steven Estes

Merge request reports