Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Server Startup and Shutdown Process


Server goes through the following process during the startup or shutdown.

  1. Server system initialization
    1. Read system parameters from configure file
    2. Initialize message catalog module. (cubrid.cat, csql.cat, utils.cat)
    3. Initialize thread manager. Initialize TSD and allocate area for all thread entry. Set master thread and initialize other threads
    4. Initialize critical section: From now on, we can use critical section
    5. Initialize error system. er_set() and error system can be used
    6. Initialize the client/server interface
    7. Initialize database (global structures has been init'ed) in boot_restart_server()
  2. client / server system (css) initialization
    1. Connect to master server: record the connection in global variables.
    2. Start up all worker/daemon threads: server could accept request now.
  3. Thread system initialization
    1. Initialize css_Job_queue
    2. Start workers: Worker threads and daemon threads are created and booted up (pthread_create() is called) . Each thread’s thread_entry is updated.
  4. Master thread performs
    1. Check the status of the connection to master.
    2. Check the status of the socket to master.
    3. When the master thread receives a request from cub master, it will create a new job and will put it into css_Job_queue. Worker thread pulls out one from job queue when it performs a job.
    4. What’s this function for? css_process_shutdown_request
  5. master thread termination
    1. Delete all jobs in css_Job_queue.
  6. Thread system shutdown
    1. Stop all worker threads and daemon threads.
    2. Kill all worker threads (send exit signal).
    3. Final job queue: Release the resource of job queue.
  7. Client/server system shutdown
    1. Shutdown all active connections
    2. Free connection list
  8. End server system
    1. Shutdown database: destroy system parameters, abort all transactions, remove temp volumes, terminate log manager and etc….
    2. Kill all workers.
    3. Finalize all critical sections
    4. Finalize thread manager
comments powered by Disqus
Page info
viewed 5764 times
translations en
Author
posted 3 years ago by
CUBRID
Contributors
updated 3 years ago by
View revisions
Share this article