-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bf: S3UTILS-180 unbounded number of sproxyd keys in Map
- Fix missing transmission of the environment variable that limits the number of keys kept in the in-memory maps (`OBJECT_REPAIR_DUPLICATE_KEYS_WINDOW_SIZE`) - Add `Number.parseInt()` calls to environment variables where needed - Sanitize a little bit the `env.js`: - reorder lexicographically - set default value of `OBJECT_REPAIR_RAFT_LOG_BEGIN_CSEQ` to `null` to make ObjectRepair use the computed default when fetched (instead of having it declared separately from `env.js`) Manually tested with a mocked oplog server returning entries with sproxyd keys: - without the fix: memory usage grows quickly (multiple GB after a few minutes) - with the fix: memory stabilizes at a level proportional to the value of `OBJECT_REPAIR_DUPLICATE_KEYS_WINDOW_SIZE` - not specifying `OBJECT_REPAIR_DUPLICATE_KEYS_WINDOW_SIZE` in the environment: stabilizes memory usage around the default value of 100000 entries.
- Loading branch information
1 parent
c680ebf
commit 44f59b0
Showing
3 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
const env = { | ||
OBJECT_REPAIR_BUCKETD_HOSTPORT: process.env.OBJECT_REPAIR_BUCKETD_HOSTPORT, | ||
OBJECT_REPAIR_SPROXYD_HOSTPORT: process.env.OBJECT_REPAIR_SPROXYD_HOSTPORT, | ||
OBJECT_REPAIR_RAFT_SESSION_ID: process.env.OBJECT_REPAIR_RAFT_SESSION_ID, | ||
OBJECT_REPAIR_RAFT_LOG_BATCH_SIZE: process.env.OBJECT_REPAIR_RAFT_LOG_BATCH_SIZE || 1000, | ||
OBJECT_REPAIR_LOOKBACK_WINDOW: process.env.OBJECT_REPAIR_LOOKBACK_WINDOW || 10000, | ||
OBJECT_REPAIR_LOG_LEVEL: process.env.OBJECT_REPAIR_LOG_LEVEL || 'info', | ||
OBJECT_REPAIR_DUMP_LEVEL: process.env.OBJECT_REPAIR_DUMP_LEVEL || 'error', | ||
OBJECT_REPAIR_LOG_INTERVAL: process.env.OBJECT_REPAIR_LOG_INTERVAL || 300, | ||
OBJECT_REPAIR_DUPLICATE_KEYS_WINDOW_SIZE: | ||
Number.parseInt(process.env.OBJECT_REPAIR_DUPLICATE_KEYS_WINDOW_SIZE, 10) || 100000, | ||
OBJECT_REPAIR_LOG_INTERVAL: | ||
Number.parseInt(process.env.OBJECT_REPAIR_LOG_INTERVAL, 10) || 300, | ||
OBJECT_REPAIR_LOG_LEVEL: process.env.OBJECT_REPAIR_LOG_LEVEL || 'info', | ||
OBJECT_REPAIR_LOOKBACK_WINDOW: | ||
Number.parseInt(process.env.OBJECT_REPAIR_LOOKBACK_WINDOW, 10) || 10000, | ||
OBJECT_REPAIR_RAFT_LOG_BATCH_SIZE: | ||
Number.parseInt(process.env.OBJECT_REPAIR_RAFT_LOG_BATCH_SIZE, 10) || 1000, | ||
OBJECT_REPAIR_RAFT_LOG_BEGIN_SEQ: | ||
Number.parseInt(process.env.OBJECT_REPAIR_RAFT_LOG_BEGIN_SEQ, 10) || null, | ||
OBJECT_REPAIR_RAFT_SESSION_ID: | ||
Number.parseInt(process.env.OBJECT_REPAIR_RAFT_SESSION_ID, 10) || undefined, | ||
OBJECT_REPAIR_SPROXYD_HOSTPORT: process.env.OBJECT_REPAIR_SPROXYD_HOSTPORT, | ||
}; | ||
|
||
module.exports = { env }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters