(CockroachDB version 2.1.2)
When building a hashjoiner, if sql.distsql.temp_storage.workmem is not enough, the storeSide will be set to the side of AddRow() function was being executed at that moment, then jump to “hjConsumingStoredSide” state. The consumeStoredSide() function will fully consume the storeSide. The storeSide is probably left or right.
So it doesn’t look like the comments in “hjConsumingStoredSide” that It will fully consume the right side. (maybe is left side)