indexedlog: make writing to indexedlog the default

Summary:
We've rolled both of these out to 100%. Let's make this the default so
we can delete those configs.

Reviewed By: quark-zju

Differential Revision: D26233645

fbshipit-source-id: cd7a08c404483f78ab714763870f5bf0fa801e7a
This commit is contained in:
Durham Goode 2021-02-11 09:33:15 -08:00 committed by Facebook GitHub Bot
parent ca1249c269
commit 9c1b611dff
37 changed files with 118 additions and 54 deletions

View File

@ -5,6 +5,7 @@
# directory of this source tree.
$ . "${TEST_FIXTURES}/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
setup configuration
$ setup_common_config

View File

@ -5,6 +5,7 @@
# directory of this source tree.
$ . "${TEST_FIXTURES}/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
setup configuration
$ setup_common_config

View File

@ -5,6 +5,7 @@
# directory of this source tree.
$ . "${TEST_FIXTURES}/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
setup configuration
$ setup_common_config

View File

@ -6,6 +6,7 @@
$ CACHEDIR=$PWD/cachepath
$ . "${TEST_FIXTURES}/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
# setup config repo

View File

@ -6,6 +6,7 @@
$ CACHEDIR=$PWD/cachepath
$ . "${TEST_FIXTURES}/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
Setup repo config (we use blob_files to share across Mononoke and API Server):
$ LFS_THRESHOLD="1000" setup_common_config "blob_files"

View File

@ -5,6 +5,7 @@
# directory of this source tree.
$ . "${TEST_FIXTURES}/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
define an extension that reveals when Mercurial is fixing up linkrevs

View File

@ -372,19 +372,20 @@ impl<'a> ContentStoreBuilder<'a> {
let shared_lfs_store = Arc::new(LfsStore::shared(&cache_path, self.config)?);
blob_stores.add(shared_lfs_store.clone());
let primary: Arc<dyn HgIdMutableDeltaStore> = if self
.config
.get_or_default::<bool>("remotefilelog", "write-hgcache-to-indexedlog")?
{
// Put the indexedlog first, since recent data will have gone there.
datastore.add(shared_indexedlogdatastore.clone());
datastore.add(shared_pack_store.clone());
shared_indexedlogdatastore
} else {
datastore.add(shared_pack_store.clone());
datastore.add(shared_indexedlogdatastore.clone());
shared_pack_store
};
let primary: Arc<dyn HgIdMutableDeltaStore> =
if self
.config
.get_or("remotefilelog", "write-hgcache-to-indexedlog", || true)?
{
// Put the indexedlog first, since recent data will have gone there.
datastore.add(shared_indexedlogdatastore.clone());
datastore.add(shared_pack_store);
shared_indexedlogdatastore
} else {
datastore.add(shared_pack_store.clone());
datastore.add(shared_indexedlogdatastore);
shared_pack_store
};
datastore.add(shared_lfs_store.clone());
let shared_mutabledatastore: Arc<dyn HgIdMutableDeltaStore> = {
@ -416,19 +417,20 @@ impl<'a> ContentStoreBuilder<'a> {
IndexedLogDataStoreType::Local,
)?);
let primary: Arc<dyn HgIdMutableDeltaStore> = if self
.config
.get_or_default::<bool>("remotefilelog", "write-local-to-indexedlog")?
{
// Put the indexedlog first, since recent data will have gone there.
datastore.add(local_indexedlogdatastore.clone());
datastore.add(local_pack_store);
local_indexedlogdatastore
} else {
datastore.add(local_pack_store.clone());
datastore.add(local_indexedlogdatastore);
local_pack_store
};
let primary: Arc<dyn HgIdMutableDeltaStore> =
if self
.config
.get_or("remotefilelog", "write-local-to-indexedlog", || true)?
{
// Put the indexedlog first, since recent data will have gone there.
datastore.add(local_indexedlogdatastore.clone());
datastore.add(local_pack_store);
local_indexedlogdatastore
} else {
datastore.add(local_pack_store.clone());
datastore.add(local_indexedlogdatastore);
local_pack_store
};
let local_lfs_store = Arc::new(LfsStore::local(&local_path.unwrap(), self.config)?);
blob_stores.add(local_lfs_store.clone());
@ -631,7 +633,13 @@ mod tests {
fn test_add_dropped() -> Result<()> {
let cachedir = TempDir::new()?;
let localdir = TempDir::new()?;
let config = make_config(&cachedir);
let mut config = make_config(&cachedir);
config.set(
"remotefilelog",
"write-local-to-indexedlog",
Some("False"),
&Default::default(),
);
let store = ContentStore::new(&localdir, &config)?;
@ -845,7 +853,13 @@ mod tests {
fn test_add_shared_only_store() -> Result<()> {
let cachedir = TempDir::new()?;
let localdir = TempDir::new()?;
let config = make_config(&cachedir);
let mut config = make_config(&cachedir);
config.set(
"remotefilelog",
"write-local-to-indexedlog",
Some("False"),
&Default::default(),
);
let store = ContentStore::new(&localdir, &config)?;
@ -1038,6 +1052,18 @@ mod tests {
let cachedir = TempDir::new()?;
let localdir = TempDir::new()?;
let mut config = make_config(&cachedir);
config.set(
"remotefilelog",
"write-local-to-indexedlog",
Some("False"),
&Default::default(),
);
config.set(
"remotefilelog",
"write-hgcache-to-indexedlog",
Some("False"),
&Default::default(),
);
let k = key("a", "2");
let store_key = StoreKey::hgid(k.clone());

View File

@ -258,19 +258,20 @@ impl<'a> MetadataStoreBuilder<'a> {
// - When pushing changes on a pushrebase server, the local linknode will become
// incorrect, future fetches will put that change in the shared cache where the linknode
// will be correct.
let primary: Arc<dyn HgIdMutableHistoryStore> = if self
.config
.get_or_default::<bool>("remotefilelog", "write-hgcache-to-indexedlog")?
{
// Put the indexedlog first, since recent data will have gone there.
historystore.add(shared_indexedloghistorystore.clone());
historystore.add(shared_pack_store.clone());
shared_indexedloghistorystore
} else {
historystore.add(shared_pack_store.clone());
historystore.add(shared_indexedloghistorystore.clone());
shared_pack_store
};
let primary: Arc<dyn HgIdMutableHistoryStore> =
if self
.config
.get_or("remotefilelog", "write-hgcache-to-indexedlog", || true)?
{
// Put the indexedlog first, since recent data will have gone there.
historystore.add(shared_indexedloghistorystore.clone());
historystore.add(shared_pack_store);
shared_indexedloghistorystore
} else {
historystore.add(shared_pack_store.clone());
historystore.add(shared_indexedloghistorystore);
shared_pack_store
};
let local_mutablehistorystore: Option<Arc<dyn HgIdMutableHistoryStore>> =
if let Some(unsuffixed_local_path) = self.local_path {
@ -285,19 +286,20 @@ impl<'a> MetadataStoreBuilder<'a> {
&self.config,
IndexedLogHistoryStoreType::Local,
)?);
let primary: Arc<dyn HgIdMutableHistoryStore> = if self
.config
.get_or_default::<bool>("remotefilelog", "write-local-to-indexedlog")?
{
// Put the indexedlog first, since recent data will have gone there.
historystore.add(local_indexedloghistorystore.clone());
historystore.add(local_pack_store);
local_indexedloghistorystore
} else {
historystore.add(local_pack_store.clone());
historystore.add(local_indexedloghistorystore);
local_pack_store
};
let primary: Arc<dyn HgIdMutableHistoryStore> =
if self
.config
.get_or("remotefilelog", "write-local-to-indexedlog", || true)?
{
// Put the indexedlog first, since recent data will have gone there.
historystore.add(local_indexedloghistorystore.clone());
historystore.add(local_pack_store);
local_indexedloghistorystore
} else {
historystore.add(local_pack_store.clone());
historystore.add(local_indexedloghistorystore);
local_pack_store
};
Some(primary)
} else {

View File

@ -2,6 +2,7 @@
$ disable treemanifest
$ setconfig remotenames.selectivepull=1
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -2,6 +2,7 @@
$ disable treemanifest
$ setconfig remotenames.selectivepull=1
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ LFSPATH=$TESTTMP/lfs
$ export LFSPATH

View File

@ -3,6 +3,7 @@
$ disable treemanifest
$ enable remotenames
$ setconfig remotenames.selectivepull=1
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -1,6 +1,7 @@
#chg-compatible
$ disable treemanifest
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
# Tests for the complicated linknode logic in remotefilelog.py::ancestormap()

View File

@ -1,6 +1,7 @@
#chg-compatible
$ disable treemanifest
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ shorttraceback

View File

@ -1,4 +1,5 @@
$ disable treemanifest
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
#testcases vfscachestore simplecachestore
$ . "$TESTDIR/library.sh"

View File

@ -1,6 +1,7 @@
#chg-compatible
$ disable treemanifest
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -1,6 +1,7 @@
#chg-compatible
$ disable treemanifest
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -1,6 +1,7 @@
#chg-compatible
$ disable treemanifest
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -2,6 +2,7 @@
$ disable treemanifest
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ cat >> $HGRCPATH <<EOF
> [remotefilelog]

View File

@ -1,6 +1,7 @@
#chg-compatible
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ hginit master
$ cd master

View File

@ -1,6 +1,7 @@
#chg-compatible
$ disable treemanifest
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -1,6 +1,7 @@
#chg-compatible
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ newserver master
$ clone master shallow

View File

@ -1,5 +1,7 @@
#chg-compatible
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ newserver master
$ setconfig extensions.lfs= lfs.url=file:$TESTTMP/lfs-server

View File

@ -1,6 +1,7 @@
#chg-compatible
$ configure modern
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ newserver master
$ setconfig extensions.lfs= lfs.url=file:$TESTTMP/lfs-server

View File

@ -1,6 +1,7 @@
#chg-compatible
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ newserver master

View File

@ -1,6 +1,7 @@
#chg-compatible
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ newserver master

View File

@ -1,5 +1,6 @@
$ . "$TESTDIR/library.sh"
$ setconfig devel.print-metrics=1
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ hginit master

View File

@ -1,6 +1,7 @@
#chg-compatible
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ cat >> $HGRCPATH <<EOF
> [treemanifest]

View File

@ -3,6 +3,7 @@
$ . "$TESTDIR/library.sh"
$ . "$TESTDIR/infinitepush/library.sh"
$ setconfig treemanifest.flatcompat=False
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ setupcommon

View File

@ -1,6 +1,7 @@
#chg-compatible
$ CACHEDIR=`pwd`/hgcache
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -3,6 +3,7 @@
$ CACHEDIR=`pwd`/hgcache
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ enable remotenames
$ hginit master

View File

@ -4,6 +4,7 @@ Push treeonly commits from a treeonly shallow repo to a treeonly server
$ setconfig remotefilelog.reponame=x remotefilelog.cachepath=$TESTTMP/cache
$ setconfig treemanifest.flatcompat=False
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ configure dummyssh
$ newrepo server

View File

@ -1,6 +1,7 @@
#chg-compatible
$ enable amend
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"

View File

@ -1,6 +1,7 @@
#chg-compatible
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ cat >> $HGRCPATH <<EOF
> [extensions]

View File

@ -4,6 +4,7 @@
#testcases vfscachestore simplecachestore
$ setconfig treemanifest.flatcompat=False
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ configure mutation-norecord
$ . "$TESTDIR/library.sh"

View File

@ -1,6 +1,7 @@
#chg-compatible
$ setconfig treemanifest.flatcompat=False remotefilelog.localdatarepack=True
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ . "$TESTDIR/library.sh"
Setup the server

View File

@ -1,6 +1,7 @@
#chg-compatible
$ . "$TESTDIR/library.sh"
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ hginit master

View File

@ -5,6 +5,7 @@ Crash in histpack code path where the amend destination already exists
$ configure mutation-norecord
$ enable undo treemanifest remotefilelog
$ setconfig treemanifest.treeonly=1 remotefilelog.reponame=foo remotefilelog.cachepath=$TESTTMP/cache
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
$ newrepo
$ drawdag << 'EOS'
> B