Commit Graph

1556 Commits

Author SHA1 Message Date
Stanislau Hlebik
9e216d711e mononoke: remove unnecessary cloning
Summary: As mbthomas suggested, let's remove unnecessary cloning

Reviewed By: markbt, mitrandir77

Differential Revision: D24196228

fbshipit-source-id: 3f82ad91dea23c1d3ffa52a0dbb3e325c663869f
2020-10-08 13:48:02 -07:00
Stanislau Hlebik
5251028e61 mononoke: fix build
Summary: looks like we got land time conflict

Reviewed By: krallin

Differential Revision: D24196362

fbshipit-source-id: 27da83a2f86cc7fe5f59fe583d4b719f69df0248
2020-10-08 12:23:19 -07:00
Stanislau Hlebik
7baf71b25a mononoke: batch path requests in commit_file_diffs
Summary:
We've run into an high cpu usage issue on commit_file_diffs request.
Looks like the problem is in the fact that ChangesetPathContext does fsnode
traversal for each path, which is very expensive if we have a lot of paths

Note - this is similar problem to D20766465 (2eebab89c5)

Reviewed By: mitrandir77

Differential Revision: D24194056

fbshipit-source-id: e808ff7c63990260c1eb2f70a8bba11c2add395c
2020-10-08 10:05:44 -07:00
Stefan Filip
fa0c15ab87 cmds: add segmented_changelog seeder
Summary:
Mononoke command for running the SegmentedChangelogSeeder for an existing
repository. The result is going to be a new IdMap version in the metadata
store and a new IdDag stored in the the blobstore resulting in a brand new
SegmentedChangelog bundle.

Reviewed By: krallin

Differential Revision: D24096963

fbshipit-source-id: 1eaf78392d66542d9674a99ad0a741f24bc2cb1b
2020-10-08 09:43:47 -07:00
Stefan Filip
aeae90f1ee segmented_changelog: add SegmentedChangelogSeeder
Summary:
The SegmentedChangelogSeeder has the role of constructing a new IdMap for a
given repository. That would happen when a repository is onboarded or when
algorithm improvements are made.

This change comes with small refactoring. We had the Dag which did a bit of
everything. Now the on_demand_update and the seeder functionalities are in
their separate files. The tests from `dag.rs` were moved to the `tests.rs` and
updated to use the seeder and on_demand_update structures.

`SegmentedChangelogSeeder::run` is the main logic added in this diff.

Reviewed By: quark-zju

Differential Revision: D24096965

fbshipit-source-id: 0f655e8c226ca0051f3e925342e92b1e7979aab2
2020-10-08 09:43:47 -07:00
Stefan Filip
225c4083da segmented_changelog: add IdDagSaveStore
Summary:
The IdDagStore provides the ability to save and later load prebuilt instances
of the IdDag.
This is going to be used in the clone API where we send one of these blobs to
the client. It is also going to be used by servers starting up.
Right now the serialization is naive, relying on serde::Serialize. The key
schema would provide the means for evolving the serialization format in cases
where we would require breaking changes.

Reviewed By: quark-zju

Differential Revision: D24096967

fbshipit-source-id: 2c883e5e82c05bec03c429c3c2a2d545170a8c05
2020-10-08 09:43:46 -07:00
Stefan Filip
6883e90d30 segmented_changelog: add IdMap, IdDag, Bundle version stores
Summary:
This IdMapVersionStore determines which is the latest IdMapVersion that commit
"tailing" processes should use when building new Dag bundles.  The "seed"
process will update the versions of the IdMap. The plan for the "seed" process
is to write a new IdMap version to Sql then update the store with a new entry.
New "tailer" processes will then start to use the newly built IdMapVersion.
The tailing processes that will build fresh IdDags for general consumption.
These IdDags will be used by the clone operation. These dags will also be used
by servers instances spinning up.
DagBundles specify (id dag version, id map vession). This pair specified a
prebuilt Segmented Changelog that is ready to be loaded.

Reviewed By: quark-zju

Differential Revision: D24096968

fbshipit-source-id: 413f49ed185a770a73afd17dfbc952901ab53b42
2020-10-08 09:43:46 -07:00
Stefan Filip
9d9a928c4c bulkops: add trait ChangesetBulkFetch
Summary:
This allows for more flexibility in structuring the code that wants to read all
the public changesets.
The usecase I have in mind is the SegmentedChangelog Seeder. The logic is
defined in the segmented_changelog crate. Constructing the Seeder is more
straight forward if it doesn't have to take direct dependency on SqlPhases and
SqlChangesets.

Reviewed By: quark-zju

Differential Revision: D24096966

fbshipit-source-id: dffa909cd27d6c05d745fd0fe0609114a50f1892
2020-10-08 09:43:46 -07:00
Mateusz Kwapich
025b509c9d use From/Into trait to make error handling less verbose
Summary:
Adding a simple from implementation to the error struct allows us to avoid
instantiating the varint explicitly.

Reviewed By: krallin

Differential Revision: D24161695

fbshipit-source-id: cb6e4c1e2cb21bd17ddff0df89a53d3f0604f562
2020-10-08 05:38:01 -07:00
Mateusz Kwapich
b178c03a4a use references instead of clones
Summary: Let's use more references when we can

Reviewed By: krallin

Differential Revision: D24161694

fbshipit-source-id: 5cf7edf843fa8dcf0d24ca114c3d520263d92a3b
2020-10-08 05:38:01 -07:00
Mateusz Kwapich
42a783999d enable single process to work on multiple repos.
Summary:
This change enables the filler job to work on all repos available instead of a
single one. We are still going to be able to dedicate the job to a certain repo
(by crafting a config with a single repo enabled) but we can put the entire
long tail for low-traffic repos under a single job.

This requires D24110335 to land in configerator to work.

Reviewed By: krallin

Differential Revision: D24136239

fbshipit-source-id: 4b77d1667c37cc55f11c3087b02a09dbae29db0f
2020-10-08 05:38:01 -07:00
Kostia Balytskyi
c02ee1b1d1 hooks: allow deletion of any files in no_insecure_filenames
Reviewed By: StanislavGlebik

Differential Revision: D24190517

fbshipit-source-id: d26a144596f0bd316a9e6b1e7000efc31b93d049
2020-10-08 05:03:37 -07:00
Alex Hornby
9756def014 mononoke: implement BlobstorePutOps for sqlblob
Summary: Implement BlobstorePutOps for sqlblob

Differential Revision: D24021172

fbshipit-source-id: be24bc0d58263e190fdca546a3adf9b5815b3c4b
2020-10-08 04:59:11 -07:00
Stanislau Hlebik
8f8345881d mononoke: allow optional bookmark in sync_commit_and_ancestors
Summary: Allow bookmark to be optional - again, will be used in the next diffs

Reviewed By: ahornby

Differential Revision: D24163608

fbshipit-source-id: e037731117181d0b1bbe4eb273301245142b507d
2020-10-08 03:48:54 -07:00
Stanislau Hlebik
6f9825eb69 mononoke: extract functionality to sync commit and ancestors from x_repo_sync_job
Summary: This functionality will be used in the next diffs.

Reviewed By: ahornby

Differential Revision: D24163517

fbshipit-source-id: 36e5c9646e21913f0e0d79d77dd11862f5aa5331
2020-10-08 03:48:54 -07:00
Kostia Balytskyi
dd64e842c3 cross_repo_sync: use parent config version when syncing merges
Summary:
This diff fixes how syncing of merge commits decides on the `CommitSyncConfigVersion` to use. Old and incorrect behavior just always uses current version from `LiveCommitSyncConfig`. The desired behavior is to reuse the version with which parent commits are synced, and manually sync commits when version changes are needed.

For merges it is more interesting, as merges have multiple parents. The overarching idea is to force all of the parents to have the same version and bail a merge if this is not the case. However, that is an ideal, and we are not there yet, because:
- there are `NotSyncCandidate` parents, which can (and should at the moment) be safely excluded from the list of parents of the synced commit.
- there are `Preserved` parents (which will turn into the ones synced with a `noop` version)
- there are `RewrittenAs` and `EquivalentWorkingCopy` parents, which don't have an associated version.

So until the problems above are solved:
- absent `RewrittenAs`/`EquivalentWorkingCopy` versions are replaced with the current version
- `Preserved` merge parents cause merge sync to fail.

Reviewed By: StanislavGlebik

Differential Revision: D24033905

fbshipit-source-id: c1c98b3e7097513af980b5a9f00cc62d248fc03b
2020-10-08 02:43:19 -07:00
Kostia Balytskyi
2035a34a0e commit_rewriting: do not create accidental Preserved syncs
Summary:
Our higher-level goal is to get rid of `CommitSyncOutcome::Preserved` altogether. This diff is a step in that direction. Specifically, this diff removes the creation of "accidental" Preserved commits: the ones where the hashes are identical, although a `Mover` of some version have been applied. There are a few sides to this fix:
- `get_commit_sync_outcome` now returns `Preserved` only when the source and target hashes are identical, plus stored version is `None` (previously it would only look at hashes).
- `sync_commit_no_parents` now records the `Mover` version it used to rewrite the commit (previously it did not, which would sometimes create `Preserved` roots)
- there are now just two ways to sync commits as `Preserved`:
  - `unsafe_preserve_commit` (when the caller explicitly asks for it). The idea is to only remove it once we remove the callers of this methods, of course.
  - `sync_commit_single_parent` when the parent is also `Preserved`. Note that automatically upgrading from `Preserved` parent to a rewritten changeset is incorrect for now: `Preserved` does not have an associated version by definition, so we would have to use a current version, which may corrupt the repo. Once we get rid of `Preserved`, this case will naturally go away.
- as we now have `update_mapping_with_version` and `update_mapping` (which consumes current version), we need to add explicit `update_mapping_no_version` for preserved commits we are still creating (again, recording a current version is a mistake here, same reason as above)

NB: I've added/changed a bunch of `println`s in tests, leaving them here, as they are genuinely useful IMO and not harmful.

Reviewed By: StanislavGlebik

Differential Revision: D24142837

fbshipit-source-id: 2153d3c5cc406b3410eadbdfca370f79d01471f9
2020-10-08 02:43:19 -07:00
Alex Hornby
4e772d07d5 mononoke: implement BlobstorePutOps for S3Blob
Summary:
Implement BlobstorePutOps for S3Blob.  This uses is_present to check the various put behaviours

While implementing this I noticed get_sharded_key could be updated to take a reference, so I did that as well.

Differential Revision: D24079253

fbshipit-source-id: 16e194076dbdb4da8a7a9b779e0bd5fb60f550a6
2020-10-07 12:11:11 -07:00
Alex Hornby
cac5350f5f mononoke: add test for blobstore OverwriteStatus
Summary: Now that fileblob and memblob support put behaviour logic, update the overwrite test to check the overwrite result.

Differential Revision: D24021167

fbshipit-source-id: d9578630205cf5d79999a459cc29481968d5717d
2020-10-07 12:11:10 -07:00
Alex Hornby
cad15511f8 mononoke: update memblob to be PutBehaviour aware
Summary: Update memblob to be PutBehaviour aware by changing implementation from Blobstore to BlobstoreOps

Differential Revision: D24021166

fbshipit-source-id: 04dd25c5535769ea507120c1886592b808a7bbc6
2020-10-07 12:11:10 -07:00
Alex Hornby
fb1d4515df mononoke: update Memblob::new callsites to ::default()
Summary: Update Memblob::new callsites to ::default() in preparation for adding arguments to ::new() to specify the put behaviour desired

Differential Revision: D24021173

fbshipit-source-id: 07bf4e6c576ba85c9fa0374d5aac57a533132448
2020-10-07 12:11:10 -07:00
Alex Hornby
9c9401f691 mononoke: add put behaviour handling to fileblob
Summary: Add put behaviour handling to fileblob so that it can prevent overwrites if requested.

Differential Revision: D23933228

fbshipit-source-id: 8e74ac96b232be841174f6ad2bd2fccf92aaa90d
2020-10-07 12:11:10 -07:00
Alex Hornby
2abe862535 mononoke: add put behaviour to BlobstoreOptions
Summary:
Add put behaviour to BlobstoreOptions in preparation for passing in the put behaviour through blobstore_factory.

Later in the stack a command line option is added to set this non-None so that we can turn on overwrite logging for particular jobs.

Reviewed By: StanislavGlebik

Differential Revision: D24021169

fbshipit-source-id: 5692e2d3912ebde07b0d7bcce54b79df188a9f16
2020-10-07 12:11:10 -07:00
Arun Kulshreshtha
5b8a25acd7 edenapi_server: log client username to scuba
Summary: Add a new "user" column to the EdenAPI server's Scuba data.

Reviewed By: krallin

Differential Revision: D24153765

fbshipit-source-id: 95a3177d9283e5b0e3f47e7f42a1de5142049b99
2020-10-07 08:17:59 -07:00
Arun Kulshreshtha
6cc6ee822f gotham_ext: add method to get username from client identity
Summary: Add a method to get the client's username from a client identity. This is helpful for logging, etc.

Reviewed By: krallin

Differential Revision: D24153766

fbshipit-source-id: 2ecf85e5de72918aeb292ce88539a991da4de900
2020-10-07 08:17:59 -07:00
Mark Thomas
5fa06fc3f1 scs_server: add pushvar support
Summary: Allow source control service clients to set pushvars.

Reviewed By: krallin

Differential Revision: D24136870

fbshipit-source-id: 34f9176ec66ca319b363c91015dae9b59a55a244
2020-10-07 07:09:40 -07:00
Mark Thomas
78f07af0ef bookmarks_movement: add pushvars for delete_bookmark
Summary:
Add the possibilty of setting `pushvars` when deleting bookmarks.  This makes
it consistent with the  other write operations.

Reviewed By: krallin

Differential Revision: D24136869

fbshipit-source-id: f98b74c6c731e50552184000ad697d04748711fd
2020-10-07 07:09:39 -07:00
Stanislau Hlebik
96d3514290 mononoke: read mutable_counters from replica in blobimport warmer
Summary:
Previously all mutable_counters reads were going to leader. This might be
useful for some cases, but in the case of blobimport warmer this opens too
many connections to sql leader.

Let's read from replica instead

Reviewed By: krallin

Differential Revision: D24160315

fbshipit-source-id: 0cecde3c54a00bbea215a1e0fa63d4a7c3dc9eaa
2020-10-07 05:24:30 -07:00
Mateusz Kwapich
2aa73b8a0b migrate sync_bookmark to new-style futures
Reviewed By: liubov-dmitrieva

Differential Revision: D24017535

fbshipit-source-id: 8d9abb13769f97eea57a7a1641e086dc518f863c
2020-10-07 05:08:40 -07:00
Mateusz Kwapich
a1fa3eb768 migrate sql_replay_bookmarks_queue module to new-style futures
Reviewed By: farnz

Differential Revision: D24017536

fbshipit-source-id: b4703d150cdcedd69c7c3b7ec77f72fe527f572f
2020-10-07 05:08:39 -07:00
Mateusz Kwapich
f95e933479 migrate replay_stream module to new-style futures
Reviewed By: farnz

Differential Revision: D24016055

fbshipit-source-id: 2b84bbe5eb7055df2b9fc7a1c38ed0b16db50a04
2020-10-07 05:08:39 -07:00
Thomas Orozco
3e6a3a02be mononoke: fix broken edenapi-server-trees.t
Summary:
This seems to have broken as a result of a land race between D23999804 (6421dca639) and
D23455274 (bdff69b747). Let's fix it.

Reviewed By: ikostia

Differential Revision: D24158809

fbshipit-source-id: 1d733e2c93eb8a0803395d409fbb15e2e2146bdd
2020-10-07 03:49:57 -07:00
Pavel Aslanov
daa5a0409a add variant of bounded_traversal_stream which accepts children in the form of a stream
Summary: Adds version of `bounded_traversal_stream` where unfold returns a stream over children instead of an iterator. This function also applies back pressure on children iteration when we have too many unscheduled items.

Reviewed By: krallin

Differential Revision: D23931035

fbshipit-source-id: 2e2806653782d4e646dcdf4b2d4e624fd6543da8
2020-10-07 03:38:28 -07:00
Meyer Jacobs
6421dca639 read_res: add --debug flag to cat command for printing entire message
Summary: Add `--debug` flag to `read_res cat` command for debug printing entire entry rather than just the data blob.

Reviewed By: kulshrax

Differential Revision: D23999804

fbshipit-source-id: 6955854edab2643cffbe5fae484a398716b48055
2020-10-06 19:22:14 -07:00
Meyer Jacobs
bdff69b747 edenapi: Add file, directory metadata to TreeEntry
Summary:
Introduce `FileMetadata` and `DirectoryMetadata` to `Treeentry`, along with corresponding request API.

Move `metadata.flags` to `file_metadata.revisionstore_flags`, as it is never populated for trees. Do not use `metadata.size` on the wire, as it is never currently populated.

Leaving `DirectoryMetadata` commented out temporarily because serde round trips fail for unit struct. Re-introduced with fields in the next change in this stack.

Reviewed By: DurhamG

Differential Revision: D23455274

fbshipit-source-id: 57f440d5167f0b09eef2ea925484c84f739781e2
2020-10-06 18:36:28 -07:00
Stanislau Hlebik
4c08208f85 mononoke: allow adding an extra that fails all pushrebase across a commit
Summary:
This diff makes it so that pushrebase fails if tries to rebase over a commit
with a specified extra "failpushrebase" set. If a client runs into this issue
then they need to do a manual rebase.

Differential Revision: D24110709

fbshipit-source-id: 82cd771c92b9fb45f4fa8794b2c736f08ac900b1
2020-10-06 13:31:39 -07:00
Alex Hornby
4f0b9c3e42 mononoke: introduce BlobstorePutOps for blobstore implementations
Summary:
This is the first part of allowing us to update mononoke blobstore put behaviour to optionally a) log when it is overwriting keys, and b) not overwrite existing keys.

Introduce BlobstorePutOps for blobstore implementations so we can track overwrite status of a put, and force an explicit PutBehaviour if required.  Its intended that only blobstore implementation code and special admin tooling will need to access BlobstorePutOps methods.

Reviewed By: farnz

Differential Revision: D24021168

fbshipit-source-id: 56ae34f9995a93cf1e47fbcfa2565f236c28ae12
2020-10-06 13:05:40 -07:00
Jan Mazur
d1c6ea4590 add --tmpdir flag to integration_runner_real
Summary:
This passes `--tmpdir` option to `~/fbcode/eden/scm/tests/run-tests.py`
so it's predictable where for example mononoke's logs will be.

Some time ago I was debugging hanging test. It was very annoying that I couldn't specify that tmpdir manually. It also wasn't printed out (it's only printed out with `--keep-tmpdir` **after** the test finishes).

Now it is possible to specify that.

Reviewed By: krallin

Differential Revision: D24137737

fbshipit-source-id: 6280832517b48ece9b65e443c236035e385efea6
2020-10-06 09:27:55 -07:00
Kostia Balytskyi
4f54418dfb commit_rewriting: useful stuff CommitSyncDataProvider
Summary:
This diff adds two things:
- the ability to compute the reverse of a `CommitSyncDataProvider::Test`, useful when creating both small-to-large and large-to-small `CommitSyncer` structs in tests
- the ability to set a current `CommitSyncConfigVersion` in the provider, which can also be useful, when simulating current version changes.

NB: I ended up not needing the set version functionality in my tests (further in the stack) in the end, so I can remove it, but I do think it will prove useful eventually.

Reviewed By: StanislavGlebik

Differential Revision: D24103206

fbshipit-source-id: 389169b2984684d83b0f6fdeb3be597d84cc0f12
2020-10-06 04:29:36 -07:00
Alex Hornby
42f5c54104 mononoke: remove unnecessary clone in packblob
Summary: Remove unnecessary clone in packblob along with the Clone constraint on the inner blobstore.

Reviewed By: krallin

Differential Revision: D24109293

fbshipit-source-id: b47e68e63b6ffda95d28d974ed6883e4ae31b3a1
2020-10-06 03:34:36 -07:00
Stanislau Hlebik
470efe709d mononoke: set correct commit sync config version if a commit was rewritten out
Summary:
This is one more fix to use correct commit sync config version. In particular,
this diff fixes a case where a single parent commit was rewritten out. E.g.
if a large repo commit touches only files that do not remap in a small repo. In
that case we still want to record correct mapping so that all descendants used
the correct mapping as well.

Reviewed By: ikostia

Differential Revision: D24109221

fbshipit-source-id: bcdbb01b964d70227dff8363e77964716a345261
2020-10-05 13:22:06 -07:00
Stanislau Hlebik
f31498754d mononoke: refactor test that checks mapping version
Summary:
Let's move initialization into a separate function. I'm planning to use it in
the next diff for another test

Reviewed By: ikostia

Differential Revision: D24109222

fbshipit-source-id: 73142dd46ef3de15ff381670ed6d5e31653c5dd4
2020-10-05 13:22:05 -07:00
Stanislau Hlebik
ae737fe22c mononoke: change fetch_bonsai_range semantics
Summary:
Previously fetch_bonsai_range returned all commits between `ancestor` and
`descendant`, but `ancestor` was included. This is usually not what we want and
it might be surprising and can lead to subtle bugs. As an example, next commit
in the stack might have failed pushrebases when it shouldn't do that.

This diff changes the semantic of the function to exclude an ancestor. This
function was used for 2 use cases:
1) Find changed files. find_rebased_set function was manually removing the
ancestor anyway, so there's no change in behaviour
2) To check that there are no case conflicts. Previously we were checking the
case conflicts with ancestor included, but that wasn't necessary. To prove that
let's go over the two possible situation:
i) This is a first iteration of the pushrebase

```
     CB
SB    |
|    ...
...  CA
SA
|  /
root

```

in that case files introduced by root commit will be used to check if we have
case conflicts or not. But this is not necessary, because pushrebase assumption
is that CA::CB should not introduce any new case conflicts. Besides, even if
they added a case conflict then checking with just the files that were changed by root commit is
not enough to verify that.
Similar logic goes to SA::SB commits. Checking if root has any conflicts with
SA::SB commits doesn't make sense.

ii) This is not the first iteration of the pushrebase

```
     CB
SB    |
|    ...
...  CA
SA
|
O <- latest pushrebase attempt
...     <- we rebased over these commits on the previous attempts

|  /
root

```

In this case it's even easier. Commit O was verified on the previous iteration,
so no need to add it here again.

Reviewed By: aslpavel

Differential Revision: D24110710

fbshipit-source-id: 90dff253cba0013e9d5e401474132a152d473cae
2020-10-05 12:49:04 -07:00
Lukas Piatkowski
9c54ea5f22 mononoke/integration tests: use $LOCALIP instead of ::1 or 127.0.0.1 (#65)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/65

Using $LOCALIP will ensure more consistent behavior when setting up the server in ipv4 or ipv6.
The LOCALIP variable was also abused when it was used to override ssh client address, so SSH_IP_OVEERIDE env was created here.
Lastly the result of `curl` call is now printed whenever the test failed to verify that Mononoke is running.

Reviewed By: farnz

Differential Revision: D24108186

fbshipit-source-id: e4b68dd2c5dd368851f0b00064088ffc442e31e0
2020-10-05 07:51:19 -07:00
Kostia Balytskyi
f81061dc45 RFC: [mononoke] make unsafe_sync_commit accept version override
Summary:
Normally, sync logic infers `CommitSyncConfigVersion` to use from parent commits (or from current version for root commits). However, for test purposes it is convenient to force a version override This logic does not change any of the production behaviors, and will be used in a later diff.

TODO: can it ever be needed beyond tests? I've thought about using this for "version boundary" commits, but those would probably just be constructed while completely bypassing the sync logic.

TBH, I am not certain this diff is a good change. But I've spend a very large amount of time crafting the repos used in the `sync_merge` tests later in this stack, so I am proposing to land this, then spend some time refactoring sync tests (and hopefully making it easier to craft test repos), then removing this logic. Obviously, this logic should only be landed if we land the tests in the first place.

Reviewed By: StanislavGlebik

Differential Revision: D24104101

fbshipit-source-id: 0825f04ed74532e89fd5f1fbebeee5f2001fedcd
2020-10-05 02:02:13 -07:00
Kostia Balytskyi
28d0c470e9 fixtures: all fixtures repos should support initrepo
Summary: It is sometimes very convenient to just inject new DAGs into existing repos.

Reviewed By: StanislavGlebik

Differential Revision: D24103164

fbshipit-source-id: abdfa18acb2f2fb1475b601a7eccb57e006982ec
2020-10-05 02:02:13 -07:00
Kostia Balytskyi
d3c43fcc29 cross_repo_sync: avoid an extra allocation
Summary: No need to allocate a new vector if we just need to remove items from the current one.

Reviewed By: StanislavGlebik

Differential Revision: D24088319

fbshipit-source-id: 10804d925f20fe8dd1e2bb8500aa06d30bd367c1
2020-10-05 02:02:13 -07:00
Kostia Balytskyi
081ca3e7d6 common: add iterhelpers
Summary:
This just adds a single fn. I did not come up with a better place/name to put
it, suggestions are welcome. Seems generic enough to belong at the top-level
common location.

I've already needed this twice, so decided to extract. Second callsite will be further in the stack.

Reviewed By: StanislavGlebik

Differential Revision: D24080193

fbshipit-source-id: c3e0646f263562f3eed93f1fdbab9a076729f33c
2020-10-04 23:51:03 -07:00
Kostia Balytskyi
2ea25308ab commit_rewriting: use is_empty() where possible
Summary: `clippy` often complains about the use of `.len() != 0`, `.len() > 0` or `.len() == 0`and proposes to use `.is_empty()` instead. This diff does that across Mononoke.

Reviewed By: aslpavel

Differential Revision: D24099427

fbshipit-source-id: 1bba2f958485b7efb3f41bf3eae820879c92b0e5
2020-10-04 10:03:42 -07:00
Simon Farnsworth
83801357d4 Make SQLBlob overwrite on put rather than ignoring
Summary:
We want to end up with two `put` behaviours - overwrite and do not overwrite.

Currently, SQLBlob only implements the latter, but some users assume that `put` always overwrites. Change to match Manifold

Reviewed By: aslpavel

Differential Revision: D24079501

fbshipit-source-id: f75cac81acf874337c38f82597aae645c41a319b
2020-10-02 10:41:12 -07:00