]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon/MonitorDBStore: improve get_chunk_tx limits
authorSage Weil <sage@redhat.com>
Tue, 12 Nov 2019 20:51:41 +0000 (14:51 -0600)
committerSage Weil <sage@redhat.com>
Mon, 2 Dec 2019 13:43:14 +0000 (07:43 -0600)
commit83b2ada9e935ae764be5649acee6ee02e4cb935f
treea57f6f0a2c96a91db4d30ada7e6ff51f573e6836
parent5103b2563db771eb2f3d4a37f51c8eb40b4e188f
mon/MonitorDBStore: improve get_chunk_tx limits

The old version was horribly inefficient in that it would reencode the
transaction on every iteration.

Instead, estimate the size if we add an item and stop it if looks like it
will go over.  This isn't super precise, but it's close enough, since the
limits are approximate.

Drop the single-use helper since it only makes the code harder to
follow.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonitorDBStore.h