Faculty of information technology


Execution of transactions


Download 1.67 Mb.
Pdf ko'rish
bet29/41
Sana17.06.2023
Hajmi1.67 Mb.
#1545014
1   ...   25   26   27   28   29   30   31   32   ...   41
Bog'liq
full thesis

4.6.4
Execution of transactions
The main loop of cs-controller will periodically load all transactions from the database
and execute them. The transactions may be divided into 2 categories: those that require
communication with routers and those that do not. If a transaction requires communication
with router, a pending configuration will be created and the transaction deleted. If a new
pending configuration is to be created while another one already exists, the new one will
overwrite the old one. If a communication with router isn’t required, the transaction will
be immediately executed and then also deleted.
For each router that has at least 1 pending configuration, is online and doesn’t already
have a delivery thread, a new thread will be created, whose goal it is to communicate the
changes to the router. After the router sends back a response, the thread is closed and the
pending configuration is changed into a permanent configuration.
Execution of transactions of a particular router is skipped while there exists its delivery
thread. The existence of the thread will normally be very short and the temporary skipping
of transactions should not negatively affect the user experience. This small concession
decreases the complexity of the system. If it wasn’t done this way, it would be necessary to
allow having multiple pending configurations of the same type for each router. A pending
configuration may only be created through a transaction, never directly.
4.6.5
Error handling
When a transaction fails due to a problem on the side of the Customer Server (for example
failure of some database operation), the information about the error is logged into a syslog
file and the transaction is marked as failed. The failed transaction then remains in the
database (for debugging purposes), but is ignored by the cs-controller. This can be done
because unlike the pending configurations, the existing transactions are not visible to the
user in any way. If an operation fails due to a problem on the side of the router, the
associated pending configuration, which is visible to the user, is marked as failed. The user
can then change the configuration, which will lead to replacement of the failed pending
configuration with a new one.
31



Download 1.67 Mb.

Do'stlaringiz bilan baham:
1   ...   25   26   27   28   29   30   31   32   ...   41




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling