mod_dup_migrate_compare internals - Orange-OpenSource/mod_dup GitHub Wiki

Migrate/Dup/Apache call sequence

Request not migrated

This sequence diagram shows how the different Apache filters are called when a request is not migrated.

This is what happens when a request is:

  • duplicated with mo_dup
  • Simply executed with no duplication

Click on the imageto see it in a comfortable size

Explanations:

  • [1] A client performs an http request on a location which mod_dup and mod_migrate are activated
  • [2] Apache receives the request, do some work and call all the translate_name hooks
  • [3][4] translateHook reads the request body using the inputfilter stack. No filter has been inserted yet, so we access the default inputfilter which allows us to read the brigades filled by the client
  • [6] We analyse the request header and body with all the declared MigrateEnv directives
  • [8] The request is not migrated. The handler is now called by Apache Orchestrer
  • [9] calls to ap_get_client_block triggers the execution of the input filters. Please note that if the handler calls these read functions before the write funtions (or never calls them), the output filters can be called before the input filters
  • [11] inputFilterBody2Brigade serves the body read by the translate_name hook translateHook
  • [15] At some point the handler performs write calls (ap_rputs, ..) to create the response. These calls will trigger the output filter stack to send the answer to the client

Request migrated

This sequence diagram shows how the different Apache filters are called when a request is migrated.

Click on the image to see it in a comfortable size

Explanations:

  • [1] A client performs an http request on a location which mod_dup and mod_migrate are activated
  • [2] Apache receives the request, do some work and call all the translate_name hooks
  • [3][4] translateHook reads the request body using the inputfilter stack. No filter has been inserted yet, so we access the default inputfilter which allows us to read the brigades filled by the client
  • [6] We analyse the request header and body with all the declared MigrateEnv directives
  • [9] mod_rewrite criteria are met, the request is migrated
  • [10] delegates the request to mod_proxy
  • [11] transfers the request to the target web server
  • [12] The target web server reads the body through mod_proxy
  • [13] intputFilterBody2Brigade has been inserted by mod_migrate and serves the request body
  • [14,15] The request is forwarded to the client
  • [16] In this scenario, the handler never sees the request