The number of job openings in the United States has topped six million for several months now according to the U.S. Bureau of Labor Statistics (BLS), up about a half million from a year ago and the highest the country has ever seen.

Although the long years of high unemployment following the Great Recession make this welcome news, the United States may face major difficulties if unemployment drops too far or too fast.

A certain amount of friction is needed to allow the economy to function. In some areas, the lack of available workers is already beginning to constrain growth, and it goes beyond specialized skillsets or workers.

I have studied labor force issues for decades. I’ve also seen the problems shortages can cause first hand as a long-time resident of the Permian Basin, where a jump in oil prices can lead to worker shortages almost overnight. With extremely low unemployment (well below 3 percent at times), it’s common to see businesses forced to pay more (even signing bonuses) to employees at all skill levels (including those in fast-food restaurants) and shorten hours of operations due to staffing problems even as demand rises. People also leave important professions (such as teaching) for higher pay elsewhere as wages are bid up. Although the situation in that area is unique because of the dominance of a single industry which is notoriously cyclical, it offers valuable insights into the problem of ultra-low unemployment.

For the United States, underlying demographic patterns (including slower population expansion and the retiring of the Baby Boomers) are pointing toward reduced workforce growth in the future. If immigration policy is overly restrictive, the situation becomes even worse. Businesses are looking for ways to deal with the problem, such as automation and other capital investments reducing the need for workers. The degree to which the substitution of capital for labor is possible varies by industry, but over time it is likely that the relative costs of machines and technology will fall compared to workers.

At the same time, machine learning and artificial intelligence could eliminate entire occupations in the future. Self-driving trucks could drastically reduce the need for drivers. Robotic retrieval systems could shrink workforce needs in warehouses. Software advances could eliminate many routine tasks. Automated online retailers reduce the need for staff in brick-and-mortar stores. While these changes free up workers, the challenge will be then equipping them to fill available jobs.

No one would argue for high unemployment, but it’s also disruptive to the economy to have too few workers to fill available jobs. Dealing with the potential shortage will require a combination of technological advances, capital investments, sound immigration policy, and innovative training (and retraining) programs.