Fix unit prefetcher version bugnightly-2020.09.06
commit2fe4429b20780f6fd9d3a665cfafc80b57278689
authorRick Lavoie <[email protected]>
Sat, 5 Sep 2020 19:20:49 +0000 (5 12:20 -0700)
committerFacebook GitHub Bot <[email protected]>
Sat, 5 Sep 2020 19:22:39 +0000 (5 12:22 -0700)
treee905b99b26d45315eb264c72a7c7bda681b53055
parentc5d2102074d441afdc25e324f4c24d420abdabeb
Fix unit prefetcher version bug

Summary:
When inserting information about a unit into the version map, we
weren't providing the current version number. Instead it was just
being default constructed, so everything got zero. As a result, later
checks would always fail and we'd enqueue the unit for
prefetching. Properly insert the current version number.

Note: This isn't a correctness issue. It's just an efficiency concern
since we don't prune pointless prefetch requests early.

While I'm at it, only increment the version if the unit is reported as
changed *and* the an unit is actually stored in the unit map. If not,
it means the unit is being created, so there's no point in treating it
as changed again. This cuts down on a lot of spurious version
increments.

Reviewed By: mofarrell

Differential Revision: D23554971

fbshipit-source-id: ee0947e9955d37adad05bf276c2b1cec8c8f15d5
hphp/runtime/base/unit-cache.cpp