Page MenuHomePhabricator

"storage upgrade" fails to acquire an adjustment lock on databases with long hostnames
Closed, ResolvedPublic

Description

After the referred upgrade running ./bin/storage upgrade --force would provide the stacktrace:

[2016-11-23 11:56:50] EXCEPTION: (Exception) Lock name "adjust/<mydb>" is too long (full lock name is "ph:phabric-6rILUDHKjHKu:<mydb>"). The full lock name must not be longer than 64 bytes. at [<phabricator>/src/infrastructure/util/PhabricatorGlobalLock.php:48]
arcanist(head=fad85844314b151994769a461825c90f7400c145, ref.master=4ca70d4e4863), phabricator(head=4dadad53ae5dc2e6ba50e8ff96cf3269b1041333), phutil(head=086df1ba443c08c41a52e712c3bb59bcad718160, ref.master=69161db9ed33)
  #0 PhabricatorGlobalLock::newLock(string) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:1146]
  #1 PhabricatorStorageManagementWorkflow::lock(PhabricatorStorageManagementAPI) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:829]
  #2 PhabricatorStorageManagementWorkflow::upgradeSchemata(array, NULL, boolean, boolean) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:78]
  #3 PhabricatorStorageManagementUpgradeWorkflow::didExecute(PhutilArgumentParser) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:107]
  #4 PhabricatorStorageManagementWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:438]
  #5 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:330]
  #6 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:249]

After git checkout 88a966993be184a7ae45663ab49c694b0736a2bf I could run the script again.

DISCLAIMER: my lock is, indeed, bigger than the maximum size specified on the file, the point is that I didn't have problems until the moment.

If the lock really has to be smaller than 64 bytes, is there a workaround of using the DB name. My DB is in Amazon RDS.

arcanist
  fad85844314b151994769a461825c90f7400c145 (Fri Oct 21)
libphutil
  086df1ba443c08c41a52e712c3bb59bcad718160 (Wed Nov 16)

Event Timeline

Thanks for the report! I think D16924 should fix this, and one other issue that came up too. Both these are related to supporting multiple partitioned masters in connection with T11044.

epriestley renamed this task from Can't run "storage upgrade" after going from 88a966993be184a7ae45663ab49c694b0736a2bf to 4dadad53ae5dc2e6ba50e8ff96cf3269b1041333 to "storage upgrade" fails to acquire an adjustment lock on databases with long hostnames.Nov 23 2016, 1:08 PM