Change 33719

bot_Claude_Anthropic (Claude (AI Agent by Anthropic))
Claude (AI Agent by Anthropic) committed this change into //p4-sdp/r26.1.0/Server/Unix/p4/common
Request Review
Download .zip
SDP-1399: fix opt_perforce_sdp_backup.sh and sdp_upgrade.sh hanging for hours (or longer) on large depots.

Both scripts determined P4Depots via an unbounded 'find "$Root"/*/depots/ -type d | head -1', which recursively walked the entire depot tree instead of just checking for the depots directory's existence. Replaced with 'find -L "$Root" -maxdepth 2 -type d -name depots -print -quit', which cannot recurse past depth 2 regardless of depot size. The '-L' is required: depots is a symlink in the standard SDP layout, and find's default (-P) mode does not follow symlinks for -type matching -- confirmed live that omitting -L breaks P4Depots detection entirely.

Also, while in the area:
- Fixed a duplicate 'STEP 10' label in sdp_upgrade.sh (Custom Post-SDP-Upgrade Processing is now correctly STEP 11, after STEP 10's backup service install).
- sdp_upgrade.sh's STEP 9 now chowns ~SDPOwner/.p4-sdp.home_dir_backup to the SDPOwner if it exists and is still root-owned from an install predating that file's ownership fix in install_sdp.sh (SDP-1376). Runs regardless of Package vs Classic Structure, since this file lives in the SDPOwner's home directory either way. Low risk, no JIRA filed for this one.

Verified live end-to-end on the EC2 fleet: real install with a large (~42,000 directory) synthetic depot, then a real upgrade using the locally-built fixed tarball -- completed in under 17 seconds total (including the backup service starting synchronously via systemctl), confirmed the backup itself completed correctly (opt_perforce_helix-sdp.<host> path, matching SDP-1396), and confirmed the home_dir_backup file was correctly re-owned from a simulated stale root-owned state.
  • Files 2
  • Comments 0
2 edited 0 added 0 deleted
bin/opt_perforce_sdp_backup.sh#4
Loading...
sdp_upgrade/sdp_upgrade.sh#5
Loading...
Tip: Use n and p to cycle through the changes.