I want test the behavior of various dbsrv16 -ufd option settings when server-level and database-level assertions occur.

I don't care what the assertion codes are, so fakes are OK.

asked 14 Mar '13, 09:29

Breck%20Carter's gravatar image

Breck Carter
27.1k424582831
accept rate: 21%

edited 08 Apr '13, 06:19

Volker%20Barth's gravatar image

Volker Barth
29.6k294444650

1

Agreed, it would be handy if one could "fake an assertion" just as one might want to fake a "database validation error" when testing a backup/validation plan - IIRC, the latter has been asked in the past...

(14 Mar '13, 10:00) Volker Barth

One way to generate assertions would be to create a database and then corrupt it by changing the checksum on one of the database pages.

WARNING: DO NOT DO THIS ON ANY DATABASE WITH REAL DATA !!

dbinit bad.db
perl corrupt_the_database.pl bad.db

where corrupt_the_database.pl is the perl script containing:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#
# Corrupt the checksum on page 3 of a SQL Anywhere database
# !! USE WITH EXTREME CARE !!
#
chmod( 0777, $ARGV[0] );
open( FOO, "+<$ARGV[0]" ) || die $?;
binmode( FOO );
seek( FOO, 3*4096-4, 0 ) || die $?;
print( FOO '\0\0\0\0' ) || die $?;
seek( FOO, 0, 2 );
close( FOO );

When you start the database on bad.db (e.g. "dbeng16 bad.db") the server will generate a "Checksum failure" assertion.

permanent link

answered 14 Mar '13, 10:01

Mark%20Culp's gravatar image

Mark Culp
22.6k9129265
accept rate: 40%

edited 14 Mar '13, 10:02

Presumably, that is a permanent error condition. Is there any way to cause a transient assertion, one that would allow dbsrv16 -ufd restart to successfully restart the database?

(14 Mar '13, 10:09) Breck Carter
Replies hidden

Yes, the corrupted checksum failure would be a permanent condition and therefore the restart attempt would fail.

I do not know of any publicly available way of causing a temporary assertion.

Perhaps one way would be to create a user table, put some data in it, add an index, shutdown the database, and then corrupt the index using a method similar to the above process. Starting the database on such a table would succeed but accessing the table may cause an assertion if the corruption was "just right". Again this type of corruption would be permanent but the restart of the database would succeed.

(14 Mar '13, 10:30) Mark Culp
Comment Text Removed

Soooo... a valuable new feature exists with no way to prove it... :)

(14 Mar '13, 10:54) Breck Carter
2

Well, we've proved it in house... but I'm working on a method for you to prove it to yourself... give me a few more minutes days.

(14 Mar '13, 11:19) Mark Culp

Take all the time you need, take weeks!

awesome

(14 Mar '13, 17:02) Breck Carter

Well, the typical EBF readme does contain several bug fixes for (temporary) assertions - some of them are declared with "under very rare circumstances" and the like, others sound reproducable.

Is that a starting point?

Yes, I know, v16 is brandnew, so there are no EBFs and readmes available yet...

permanent link

answered 14 Mar '13, 10:47

Volker%20Barth's gravatar image

Volker Barth
29.6k294444650
accept rate: 32%

@Breck: Are you working on "The top 10 cool features of SQL Anywhere 16"? (In case that allows for a publicly available answer:))

(14 Mar '13, 10:48) Volker Barth
Replies hidden
2

@Volker: What a great idea, someone should write that!

(14 Mar '13, 10:55) Breck Carter

Well, someone seems to have just done that:

Top 10 Cool New Features in SAP Sybase SQL Anywhere 16...


Isn't that a smart "nearly-invisible announcement":)

(08 Apr '13, 05:52) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×194
×101

question asked: 14 Mar '13, 09:29

question was seen: 1,827 times

last updated: 08 Apr '13, 06:19