History log of /external/autotest/frontend/db_router.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9a535c9f3144690cf85d88a51e07b98c21454159 24-Nov-2014 Dan Shi <dshi@chromium.org> [autotest] Add server database to django model.

Server database is added to store information about servers running in an
Autotest instance. This is the first CL to implement it. Design doc:
go/chromeos-lab-serverdb-design

django model uses db_router to rout database calls to different database
connections:
local: All AFE table calls.
global: All TKO table calls.
readonly: Calls from web frontend.

This CL adds another router for all calls to server database to `server`.

DEPLOY=migrate_server_db
CQ-DEPEND=CL:230814
BUG=chromium:424778
TEST=unitest, part of the test is done by atest code that'll be in another cl.
Test server database migration:
./database/migrate.py sync 0 -d AUTOTEST_SERVER_DB
./database/migrate.py sync 1 -d AUTOTEST_SERVER_DB
./database/migrate.py sync 2 -d AUTOTEST_SERVER_DB
./database/migrate.py sync 3 -d AUTOTEST_SERVER_DB
python frontend/health/utils_unittest.py

Change-Id: I84be386c8f5b7efd53ae1ecbd6293eae4326f19f
Reviewed-on: https://chromium-review.googlesource.com/231671
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/db_router.py
8a764d1fb6cd99d08cda6400bd35162fa3ac5fe0 15-Oct-2014 Jakob Juelich <jakobjuelich@chromium.org> [autotest] Use global database for tko models in django v3.

This adds the global database to django.
A django database router is added to determine to which database
should be used for which models. All tko models are always taken or
written from or into the global database while all other objects
remain unchanged.

BUG=chromium:422637
TEST=Ran suites, syncdb, restart apache, ran a suite.
Confirm global database connection is closed after each attempt to get
test view: https://x20web.corp.google.com/~beeps/log/db_routers.html

Change-Id: Idf6933d1d112bbc5a2896fa61afd03f6604dafb5
Reviewed-on: https://chromium-review.googlesource.com/223501
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/frontend/db_router.py
3270e189d5da845d034231a6eb75c5bd4e37ac97 13-Oct-2014 Jakob Juelich <jakobjuelich@chromium.org> Revert "[autotest] Always use tko tables on master from shards."

This reverts commit e2bf396b7d3870f7565b2b10018087ab7fa6256e.

BUG=422637
CQ-DEPEND=CL:223065

Change-Id: I0513889a3acfc3a189843e79030da9bbd551999d
Reviewed-on: https://chromium-review.googlesource.com/223072
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
/external/autotest/frontend/db_router.py
e2bf396b7d3870f7565b2b10018087ab7fa6256e 02-Oct-2014 Jakob Juelich <jakobjuelich@chromium.org> [autotest] Always use tko tables on master from shards.

tko/db.py was changed to always use settings for the global database.
This added configuration overhead for non-shard machines. This adds
the normal, old settings as a failover.

Also, this adds the global database to django.
A django database router is added to determine to which database
should be used for which models. All tko models are always taken or
written from or into the global database while all other objects
remain unchanged.

BUG=chromium:419435
TEST=Ran suites and manually tried rpcs.
DEPLOY=apache,tko

Change-Id: I675b064ffdcb0440cd33835b9a83e3858f826ca7
Reviewed-on: https://chromium-review.googlesource.com/221018
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
/external/autotest/frontend/db_router.py