Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-38277][SS] Clear write batch after RocksDB state store's commit
### What changes were proposed in this pull request? This PR proposes to clear the write batch (and also corresponding prefix iterators) after commit has succeeded on RocksDB state store. This PR also fixes the test case as side effect, as it had been relying on the "sort of bug" that we didn't clean up write batch till either rollback or load has been called. ### Why are the changes needed? Without this, the memory usage of WriteBatch for RocksDB state store is "accumulated" over the partitions in the same executor. Say, 10 partitions in stateful operator are assigned to an executor and run sequentially. Given that we didn't clear write batch after commit, when the executor processes the last partition assigned to it, 10 WriteBatch instances contain all writes being performed in this microbatch. ### Does this PR introduce _any_ user-facing change? No. This is a sort of bugfix. ### How was this patch tested? Existing tests, with fixing the test case. Closes apache#38880 from HeartSaVioR/SPARK-38277. Lead-authored-by: Jungtaek Lim <[email protected]> Co-authored-by: Yun Tang <[email protected]> Signed-off-by: Jungtaek Lim <[email protected]>
- Loading branch information