Salesforce

AIMGT archives the wrong ai file after disabling AI online and re-enabing AI and AIARCHIVER online 12161 13188

« Go Back

Information

 
TitleAIMGT archives the wrong ai file after disabling AI online and re-enabing AI and AIARCHIVER online 12161 13188
URL NameP139759
Article Number000139850
EnvironmentProduct: OpenEdge
Version: 10.1B and later , 11.x to 11.7.4 inclusive
OS: All supported platforms
Other: AIMGT
Question/Problem Description
AI files are not backed up after enabling AI and AIARCHIVER online after previously disabling AI online with AIOFF
Errors 12161 13188 errors after enabling After Imaging and aiarchiver with an online PROBKUP.
AIMGT tries to archive the wrong ai file when AI and AIMGT are re-enabled online
Full ai files remain when manually switching AI extents with RFUTIL aimage new
Database eventually stalls when last fixed size ai file is FULL and cannot switch to the next AI extent 3775
Steps to Reproduce$ rfutil dbname -C aiarchiver end
$ rfutil dbname -C aimage new
$ rfutil dbname -C aimage new
$ rfutil dbname -C aimage list | egrep "Extent|Status|Seqno"
$ rfutil dbname -C aimage aioff
$ probkup online dbname dbname.bak enableai enableaiarchiver -aiarcdir .\bkup\ai
Clarifying Information
After Imaging was enabled on the database before, but was turned off while the database running using rfutil <dbname> -C aioff
Error MessageFrom this point forward all after-image extents will be archived to <path>.
(12161) The after-image extent <path>\<dbname>.a3 must be FULL before its contents can be extracted.
(13188) Error -30034 occurred when archiving after-image extent <path>\<dbname>.a3.

(3775)  Can't switch to after-image extent /<path>/<dbname>.a1 it is full.
Defect NumberEnhancement OE00179832 / PSC00209861 / OCTA-4009
Enhancement Number
Cause
When After-Imaging is re-enabled online, the sequencing is re-set to the first AI file.
The AIMGT deamon still has reference to the previous online FULL ai files that needed to be archived at the time (but were not) when AI was disabled online (aioff).

The current design of disabling after-imaging online did not consider that it would need to be enabled immediately afterwards without first having to shut the database down to first resolve the reasons it had to be disabled:
  • The problem is that the aiarchiver checks for full AI extents to archive by examining the AI area descriptor headers. 
  • Before actually archiving the extent, the archiver reads the first AI Block of the extent to make sure that it is actually full before archiving it. If it is not, the 12161 error as described above is thrown:
  1. Disabling AI imaging online does not clear out the AI area descriptors which means that any information in the AI area descriptors will remain. 
  2. When re-enabling AI online with the aiarchiver after disabling online when there were full AI extents, the AI archiver will erroneously determine that there are full AI extents to archive from the information in the AI area descriptors which means that the aiarchiver will loop with the 12161 error.
Resolution
Upgrade to OpenEdge 11.7.5, 12.0 or later where AI area descriptors are nulled out before writing the AI area descriptor header to the first extent when enabling AI imaging online.

For versions prior to OpenEdge 11.7.5, 12.0:

Option 1:  After disabling After-Imaging online with "rfutil dbname -C aimage aioff", restart the database before re-enabling AI and AIARCHIVER online with PROBKUP.

Option 2:  Before disabling After-Imaging online:

Always verify the current AI extent status:
$   rfutil <dbname> -C aimage list | egrep -i "Status|Path"

A.   Re-evaluate if After-Imaging itself really needs to be disabled online.

If the AI Archiver is not archving and emptying ai extents, other options are:
  1. Change the current archive directory to one that is accessible and has space with aiarchiver setdir
  2. Stop the AI archiver online with aiarchiver end then either manually archive with aiarchive nextextent or re-start the deamon
  3. Disable only AIMGT online with aiarchiver disable then ai files can be manually archived with OS tools and emptied with aimage empty, before (re)enabling AIMGT online which requires an ai switch, with: probkup online dbname dbname.bak enableaiarchiver -aiarcdir
If the database is enabled for Replication and ai extents are LOCKED, other options are:
  1. Restart both the Replication Server and Replication Agent
  2. Add additional AI areas to the database. 
  3. Disable replication and then re-initialize replication
These Options are further outlined in Article  All after imaging (AI) areas are in LOCKED state after network failure  

B.  If After-Imaging itself really needs to be disabled online

Before disabling After-Imaging online, ensure all FULL AI extents have been archived.  These can be manually archived online with AIARCHIVE NEXTEXTENT to a new archive directory if needed

This ensures when the aiarchiver is re-enabled with after-imaging online without first shutting down the database, it expects to archive the first full ai file when switched which will be the first ai file (.a1, sequence 1).

Refer to Article  How to manage the aiarchiver daemon online  

1.   Take a list of all current FULL AI extents:
$   rfutil dbname -C aimage list | egrep -i "Status|Path"

2.  Archive all FULL AI extents

If the current archive directory needs to be changed:
$   rfutil dbname -C aiarchiver setdir <FULL/ARCHIVEPATH>

Manually instruct FULL ai extents to be archived.
$   rfutil dbname -C aiarchive nextextent

Alternatively, manually archive each FULL AI extent ensuring the destination is accessible and has sufficient space
$   rfutil dbname -C aiarchiver end
$   rfutil dbname -C aiarchive extent <path>/<dbname>.a3 <FULL/ARCHIVEPATH>/<dbname>.a3

3.   Before disabling After-Imaging online, verify the current AI extent status. All FULL extents will be marked EMPTY after being manually archived.
$   rfutil <dbname> -C aimage list | egrep -i "Extent|Status|Seqno"

4. Disable and re-enable After-imaging online 
$   rfutil <dbname> -C aimage aioff
$   probkup online <dbname> <dbname>.bak enableai enableaiarchiver -aiarcdir "<dir1>,<dir2>" [ -com -vs < $BKFILEVOLS ]


 
Workaround
As outlined above, ideally and recommended before disabling After-Imaging online, always verify the current AI extent status and take note of all ai files that have not been archived:
$   rfutil <dbname> -C aimage list | egrep -i "Extent|Status|Seqno"
$   rfutil <dbname> -C aimage aioff

Once the reasons After-Imaging had to be disabled are resolved, AI can be re-enabled online:
$  probkup online dbname dbname.bak enableai enableaiarchiver -aiarcdir .\bkup\ai

To initially work around the numerous 12161 and 13188 errors :

Once the AIMGT deamon starts, run "rfutil <db-name> -C aimage new" until after imaging switches to the ai file listed in the error message.
 
Example: 

AIMGT   5: (13231) From this point forward all after-image extents will be archived to C:\aiarchs
AIMGT   5: (12161) The after-image extent C:\aiarchs\dbname.a3 must be FULL before its contents can be extracted.
AIMGT   5: (13188) Error -30034 occurred when archiving after-image extent C:\aiarchs\dbname
  • AI extent a3 is reported in the 12161 message.  
  • When After Imaging is enabled it starts with the first AI file, sequence 1 (.a1)
  • Switch AI extents twice to sync the aiarchiver with After Imaging : rfutil <db-name> -C aimage new
  • If there were more than one ai extent the AIMGT needed to archive before AI was disabled, the next set of 12161 13188 messages will indicate the need for further "rfutil <db-name> -C aimage new" switches.
Notes
Keyword Phrase
Last Modified Date11/20/2020 6:59 AM

Powered by