During the American Civil War, the bulk of the Union Army was composed of volunteer forces raised by individual states and led by dozens of federally appointed major generals of volunteers.
To unblock the promotion flow, Congress mandated in 1882 that officers must retire at age 64, but could retire sooner if they had at least forty years of service.