cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Remote sends data that hasn't been checkpointed

JimDiaz
Participant
0 Kudos
1,424

We noticed during some testing that SQL Remote will send data that hasn't been checkpointed (not sure that's a word).

We did a disaster recovery senecio where we forced a crash of a database involved in replication during the application of replication messages. We recovered the database by unloading and reloading then setting the offsets appropriately. At this point the offsets were set to the end of the log file that was in service when the disaster occurred. There were many transactions in that log file which were not applied to the crashed database since it was not a clean shutdown.

When we ran SQL Remote in sent the transactions that were not applied to the remotes. The end result of course was the remote had data the consolidated did not have which of course is a problem.

How do you recover from this? I've asked a related question regarding applying log files to a rebuilt database.

Thanks

Jim

Accepted Solutions (0)

Answers (2)

Answers (2)

VolkerBarth
Contributor

Well, IMHO if you decide to

  • use the current log of a crashed database as offline log,
  • but do a restore of the crashed database file without that log (and apparently therefore lacking some transactions) and make a rebuild of the restored database and force the log offsets to "fit" and use that with SQL Remote,

it seems quite clear that there's a discrepancy between the data published by SQL Remote (based on the offline log) and the database contents itself, that the database itself can not notice...


FWIW, even using "DBREMOTE -u" (i.e. only using transactions from offline logs) would not prevent that situation in my understanding while using your steps. However, in that case you might have gone back to the last backup and then use the current log to bring the database up-to-date (unless that would fail again due to the file size limitations). With v17, you might use Point-in-time recovery here.

JimDiaz
Participant
0 Kudos

Thanks for your comments.

You go that right the -u and the last backup most likely would have solved this issue.

In this case we would have started with the last backup applied all files BEFORE the crash, unloaded and reloaded set the offsets to the log file before the crash and place in operation. Theoretically this would have caused all remotes to resend because no fresh/new replication messages would apply.

We have changed our dbremote process to incremental backup, receive, incremental backup send, incremental backup with the -u option in dbremote. Important to note our consolidated does nothing but support replication including a couple of post receive hooks to process some incoming data.

JimDiaz
Participant
0 Kudos

I do recommend that SAP consider a couple of changes

1) Don't grow a DB Space beyond it's limits 2) Don't allow DBRemote to process data that has not been through a Checkpoint

VolkerBarth
Contributor
0 Kudos

Hm, we have used SQL Remote for quite "immediate" responses between cons and remotes, so waiting for a checkpoint would have been undesired.

Can't comment on the file size limits, never been there 🙂

regdomaratzki
Product and Topic Expert
Product and Topic Expert
0 Kudos
  1. We can't grow a DB space beyond it's limit. Do you mean "check to see if growing the dbspace would exceed the maximum number of pages before attempting to grow" ?
  2. Like Volker, I think waiting for a checkpoint is poor idea. You can get very similar behaviour by running dbremote with the -u switch, which severely limits (if not eliminates) the possibly of losing a transaction log that dbremote has sent messages from.
VolkerBarth
Contributor
0 Kudos

Well, a GrowDB system event could certainly warn and/or enforce reasonable actions when a critical threshold (say .95% of the maximum file size) has been used.

JimDiaz
Participant
0 Kudos

Yes to your number 1, that's exactly what I was thinking. There are other technical issues, like what do you do with the data coming in that might need the space?

As I understand it -u has nothing to do with applying messages, perhaps checkpoint could be an option.

VolkerBarth
Contributor
0 Kudos

As stated here and on your related older question, I still guess a GrowDb event handler could already help to prevent a database halt once a critical size limit is hit. Would that not help here?

Note, if the engine's behaviour can be improved here, that's fine - but I would not expect changes for version 16, so I don't think you should wait on that...