LOG:
savepoint
<transactions>
commit
transactions
here when there is failure the log is read line by line so in the above case it will redo all the commited transactions after the save point and undo all the transactions which are not committed
if there are only committed transactions after savepoint and no uncommiteed transactions then only redo is done
if there are only uncommitted transactions after savepoint and no commiteed transactions then only undo is done
i think there is need to be some order as after undoing we cannot redo which will give inconsistent data i think