Add Azure Linux support to MongoDB/YCSB workload (runtime package-manager detection) - #783
Conversation
…ge manager detection The Ubuntu and AzureLinux MongoDB YCSB profiles were identical except for the MongoDB repository setup and install steps (apt/gnupg vs rpm/dnf). Collapse the six divergent dependency steps into single ExecuteCommand steps that run with UseShell and branch on the available package manager, so one profile covers both operating systems. Removes PERF-MONGODB-YCSB-AZURELINUX.json. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve the mongod service account at runtime instead of hardcoding 'mongodb'. RPM packages (Azure Linux, RHEL, Fedora) create a 'mongod' account while Debian packages create 'mongodb', so the data directory was left owned by root and mongod exited with status 100. Open the MongoDB port via IFirewallManager during initialization. Azure Linux applies a default-deny inbound policy (iptables INPUT policy DROP), so the client could not reach the server. Both failures were previously downgraded to warnings, so runs reported exit code 0 while MongoDB had never started. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The thread sweep profile is out of scope for the Azure Linux onboarding change and is not referenced by any test, documentation, or other profile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Read_Latest (workloadd) and Short_Range_Scan (workloade) both perform 5% run-phase inserts. YCSB seeds the insert key sequence for both scenarios at recordcount, so the scenario that runs second collides with keys already written by the first and every insert fails with: E11000 duplicate key error collection: ycsb.usertable index: _id_ Measured on a 2500000 record run, Short_Range_Scan reported INSERT-Operations=0 with INSERT-FAILED-Operations=3445, matching the 3445 duplicate key errors in the logs exactly. Setting mongodb.upsert=true makes colliding inserts update the existing document instead of failing. This is the documented behaviour of the YCSB MongoDB binding for partially loaded data sets and requires no change to RecordCount, operation mix, metric names or scenario names. This issue is not platform specific and reproduces on both Ubuntu and Azure Linux. Verified on Azure Linux 3 and Ubuntu 24.04 (2 VM client/server, exit code 0, all 7 scenarios): Short_Range_Scan now reports non-zero INSERT-Operations with zero failed operations and no E11000 errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Azure Linux support work had merged four dependency steps (MongoGPGKey, MongoGPGDearmor, MongoAddRepository, MongoUpdatePackageList) into a single MongoAddRepository scenario. That removed three scenario names that exist on main, which changes the telemetry emitted for the workload and breaks any downstream query or dashboard that filters on those names. Restore the four steps as separate dependencies so each one performs a single action, while keeping the package-manager detection that provides Azure Linux support. The dependency scenario list is now identical to main. Also complete the package manager guards on MongoInstallServer and MongoInstallClient. These previously used a two-way if/else that silently fell through to dnf on any host without apt-get. They now explicitly test for dnf/tdnf and fail with a clear message on unsupported package managers, matching the guards used by the repository setup steps. Note: the unsupported package manager branch is unverified. Both test hosts had a supported package manager present, so the exit 1 path was never exercised. Verified on Azure Linux 3 and Ubuntu 24.04 (2 VM client/server, exit code 0, all 7 scenarios, no failed operations). All four steps execute in order on both distributions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Alternative implementation of the same feature: #784 (declarative \SupportedLinuxDistributions\ filtering). These two PRs conflict in \PERF-MONGODB-YCSB.json\ — only one should be merged. Happy to close whichever the team doesn't prefer. |
@microsoft-github-policy-service agree company="Microsoft" |
|
Closing out the one open item from the description: the Method: each step's Result - all 6 steps exit 1 with the intended stderr message: The PR description has been updated accordingly. Happy to contribute the harness as a test asset if the team wants it in-repo - I left it out because the repo's test suite is NUnit and these are profile JSON strings rather than C#. |
Bryan DeYoung (brdeyo)
left a comment
There was a problem hiding this comment.
Thank you for offering the different options. Per the conversation in Teams, I like your second option #784, the declarative approach. I have approved that PR. If you are ok with it, let's abandon this one and go with that one.
Thanks again for the great work here to try to align the platform for versatility and reusability.
|
Closing this in favour of #784. Per review feedback on this PR, the team selected the declarative approach in #784 (a generic The documentation change from this PR (adding The two product fixes validated here are also in #784:
|
Summary
Adds Azure Linux 3 (Mariner) support to the MongoDB/YCSB workload, which previously ran on Ubuntu only. Also fixes two product bugs in
MongoDBServerExecutorthat prevented the server from starting on any RPM-based distribution.Product fixes (
MongoDBServerExecutor.cs)These are genuine bugs, not Azure-Linux-specific workarounds:
Hardcoded
mongodbservice account. The data directory waschowned to a hardcodedmongodbuser. RPM packages create the account asmongod, somongodcould not write to its owndbPathand failed to start. Now resolved at runtime per package family (mongodbon Debian/Ubuntu,mongodon RPM).MongoDB port never opened on the local firewall. Ubuntu's default
iptablesINPUTpolicy isACCEPT, so this was silently unnecessary there. Azure Linux defaults toDROP, so the client could never reach the server.InitializeAsyncnow opens the port via the existingIFirewallManager.Profile changes (
PERF-MONGODB-YCSB.json)apt/dnf) at runtime, so the scenario list is unchanged frommain.lshwandgnupg2, which Ubuntu images preinstall but Azure Linux does not.-p mongodb.upsert=trueto theRead_LatestandShort_Range_Scanscenarios (see below).Fixes pre-existing duplicate-key insert failures
Read_Latest(workloadd) andShort_Range_Scan(workloade) both perform 5% run-phase inserts. YCSB seeds both insert sequences atrecordcount, so whichever runs second collides on every insert:The error count matched
INSERT-FAILED-Operationsexactly (3445/3445). This is pre-existing onmainand reproduces identically on Ubuntu — it is not introduced or caused by Azure Linux.mongodb.upsert=trueis the documented remedy for a partially loaded data set.Behavioural note: colliding inserts now become updates, so INSERT latency is measured where it previously reported 0 successful ops.
RecordCount, metric names, the operation mix, and scenario names are unchanged.Testing
Unit tests (new, in
MongoDBServerExecutorTests.cs):MongoDBServerExecutor_ConfigureDisk_ResolvesTheMongoDBServiceUserForThePlatformMongoDBServerExecutor_InitializeAsync_OpensTheMongoDBPortOnTheLocalFirewall92/92 MongoDB tests pass against current
main.End-to-end, two-VM client/server (
Standard_D8s_v5):Azure Linux throughput (ops/sec): Initialize 4439.4 · Update_Heavy 2629.7 · Read_Mostly 3501.0 · Read_Only 4205.2 · Read_Latest 7115.9 · Short_Range_Scan 71.4 · Read_Modify_Write 2386.7
Ubuntu regression risk was explicitly exercised, not just reasoned about: the firewall rule was flushed before the Ubuntu run so the new code path genuinely executed, and it completed without throwing. Measured data-directory ownership confirmed
mongodbon Ubuntu andmongodon Azure Linux.Unsupported package manager fallback
The
elsebranch that fails fast when no supported package manager is present has been verified explicitly.Each step's
Commandstring was extracted from the committed profile and executed against a sandboxPATHcontaining every normal system tool (1,585 executables —bash,curl,tee,grep, etc. all present) but withapt-get,apt,dnf,tdnf,yumandzypperremoved. The sandbox asserts both halves of that condition before running anything, so the test cannot silently pass for the wrong reason.All six steps exit
1and emit the intended diagnostic on stderr: