Skip to content

Cleanup 9apr25 #4073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 231 commits into from
Closed
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
724b186
CEP-15 (C*): Messaging and storage engine integration
bdeggleston Oct 21, 2022
2872b51
add AsyncChain implementations and tests
bdeggleston Jan 27, 2023
3ae6a05
CEP-15/Accord Immutable State Refactor
bdeggleston Feb 3, 2023
2141ad1
Remove git hook for pre-push as it is redundant and causes issues whe…
dcapwell Mar 9, 2023
2411579
CEP-15: (Accord) Migrate Accord away from JDK random to a new interfa…
dcapwell Mar 10, 2023
b3cbb20
Improve transaction statement validation
jacek-lewandowski Mar 16, 2023
a94f812
fixing remaining (mostly compilation) issues after initial rebase of …
maedhroz Mar 16, 2023
6038c90
Operations.migrateReadRequiredOperations fails due to concurrent acce…
dcapwell Mar 17, 2023
a396e35
CEP-15 (Accord) Expected reply message with verb ACCORD_INFORM_OF_TXN…
dcapwell Mar 31, 2023
821f239
CEP-15 (Accord) Original and recover coordinators may hit a race cond…
dcapwell Apr 7, 2023
8fe40b1
CEP-15: (C*) Accord message processing should avoid being passed on t…
dcapwell Apr 27, 2023
5f40443
CEP-15: (C*) Enhance in-memory FileSystem to work with mmap and suppo…
dcapwell May 8, 2023
4fcb4b1
CEP-15: Store PreAccept, Accept, Commit, and Apply messages
iamaleksey Feb 16, 2023
61d999e
(Accord only) Permit nodes to join a cluster without the full transac…
belliottsmith Apr 27, 2023
fc1e2bc
- make sure workspace.xml specifies a storagedir
May 26, 2023
82cfde5
CEP-15: (C*) Add notion of CommandsForRanges and make this durable in C*
dcapwell May 25, 2023
4b739d6
CEP-15: Extend Accord MessageType with a side effect flag
iamaleksey Jun 2, 2023
8c21ea5
CEP-15: Convert AccordStateCache cache from write-through to write-back
iamaleksey Jun 2, 2023
1b1e290
CEP-15: Accord Bootstrap Integration
bdeggleston Jun 7, 2023
8e14735
Support state eviction (i.e. permit the state machine to erase transa…
belliottsmith Aug 15, 2023
532feb2
CEP-15 (C*) When a host replacement happens don't loose the peer mapp…
dcapwell Aug 16, 2023
5a59f45
CASSANDRA-18774: Fix pre-commit hook
jacek-lewandowski Aug 17, 2023
a1ac5f5
Allow exceptions to be propagated remotely
aweisberg Aug 18, 2023
a6554fd
CEP-15 (C*): when loading commands that have empty waiting_on, make s…
dcapwell Aug 21, 2023
a503877
Bootstrap/TCM integration test fixes
bdeggleston Mar 26, 2024
e6e9e30
Fix Accord compaction purger tombstone logic
dcapwell Aug 16, 2023
9edce1c
CEP-15: (C*) accord.messages.BeginRecovery.RecoverNack#supersededBy i…
dcapwell Sep 14, 2023
857e9ce
- Avoid persisting fragments that do not require completion as Update…
Sep 20, 2023
9e37f30
CEP-15: Minimize transaction state kept in system tables
iamaleksey Jun 28, 2023
327af9a
ninja-fix: checkstyle fixes in VirtualTableTest, HistoryValidatorTest…
maedhroz Sep 27, 2023
7919fb8
ninja-fix: minor post-TCM-rebase cleanup
maedhroz Sep 29, 2023
8dc447c
CEP-15: Accord metrics
jacek-lewandowski Oct 10, 2023
e4d52d7
CEP-15: Add Accord configuration stub
jacek-lewandowski Oct 9, 2023
3c12d13
CEP-15: (C*) Implement TopologySorter to prioritise hosts based on Dy…
dcapwell Oct 18, 2023
a928023
Use pinned Harry version
ifesdjeen Oct 19, 2023
dc91465
Several simulator fixes not yet merged to cep-15-accord
jonmeredith Jul 7, 2023
dec690f
Accord/non-Accord interoperability and support for live migration
aweisberg Jan 23, 2023
dc689cf
Fix Paxos V2 prepare response serialization
aweisberg Nov 13, 2023
511074f
Quick fix for AccordCommandStoreTest#commandLoadSave()
iamaleksey Nov 17, 2023
9b1e22b
Improve validation and address various discovered faults
belliottsmith Oct 9, 2023
53fefba
Reduce command deps
bdeggleston Oct 27, 2023
fcac5d1
Fix additional live migration/interop merge issues
aweisberg Nov 29, 2023
1be0dd7
Fix Mutation serializer
aweisberg Dec 5, 2023
810b074
Fix AccordCommandsPurger universal durability check
aweisberg Dec 4, 2023
72a8849
Fix TombstoneCountWarningTest
bdeggleston Dec 6, 2023
0e6a620
Schema based accord fast path configuration
bdeggleston Dec 19, 2023
b48d512
(Accord) NPE while trying to serialize FoundKnownMap as value is null…
dcapwell Jan 8, 2024
fd0024b
(Accord): Bug fixes from CASSANDRA-18675 to better support adding key…
dcapwell Jan 4, 2024
58a5f7d
Pre-requisite changes for CASSANDRA-18888
iamaleksey Nov 17, 2023
89b72c6
Fix LocalPartitioner duplication in *_for_key Accord system tables
iamaleksey Jan 18, 2024
0437826
CASSANDRA-18365: Protocol fixes
belliottsmith Jan 17, 2024
6147578
Get simulator working (again)
dcapwell Oct 4, 2023
723610c
Fix (de)serialization of WaitingOn into cache
belliottsmith Feb 7, 2024
070f654
Add TODO for TxnQuery using wrong cluster metadata
aweisberg Feb 15, 2024
5376ae4
Fast single-partition "Ephemeral Reads"
belliottsmith Jan 29, 2024
d8f1280
Refactor CommandsForKey for efficiency, and to support transitive dep…
belliottsmith Feb 15, 2024
4cdefe3
CEP-15: (C*) per-table transactional configuration
bdeggleston Mar 26, 2024
f20acef
fix MultiElementType pack/unpack accessor api
bdeggleston Mar 27, 2024
8f88bd3
post-trunk rebase fixes
bdeggleston Mar 27, 2024
56106d7
perf improvements
belliottsmith Feb 28, 2024
280aec9
Ninja for CASSANDRA-19305: Disable EphemeralRead by default to get be…
dcapwell Mar 29, 2024
8c7ebf8
Accord: PreLoadContext must properly and consistently support ranges
dcapwell Mar 29, 2024
c724454
(Accord) Cassandra bootstrap no longer using the range txn and instea…
dcapwell Apr 1, 2024
ceebe6b
When jvm-dtest is shutting down an instance TCM retries block the shu…
dcapwell Apr 3, 2024
a43306c
CEP-15 (C*) Integrate accord with repair
bdeggleston Feb 15, 2024
9a24459
Prohibit counter column access in Accord transactions
maedhroz Apr 26, 2024
ab4ef82
Accord: NPE in RangeDeps.forEach
dcapwell May 1, 2024
fd37498
post-rebase fixes, mostly around CASSANDRA-19341 and CASSANDRA-19567
maedhroz May 8, 2024
f8dd392
Accord: Need to simulate Cassandra Journal in Accord BurnTest to dete…
dcapwell May 3, 2024
980a34c
Move preaccept expiration logic away from Agent
iamaleksey May 13, 2024
e42936c
IndexOutOfBoundsException while serializing CommandsForKey
dcapwell May 17, 2024
903cda4
Baseline Diagnostic vtables for Accord
maedhroz May 13, 2024
c8347eb
Accord barrier/inclusive sync point fixes
aweisberg May 17, 2024
e65ee4d
Accord Journal Determinism: PreAccept replay stability
ifesdjeen May 29, 2024
13f4628
ninja: fix cqlsh tests
bdeggleston Jun 6, 2024
ad00f0c
CEP-15: (Accord) Bootstraps LocalOnly txn can not be recreated from S…
dcapwell May 31, 2024
64c5cb9
Move burn test read timestamp validation from replica to coordination
bdeggleston Jun 18, 2024
cbfbde8
Don't run incremental repairs for consensus only repairs
bdeggleston Jun 17, 2024
1f7f3a5
ApplyThenWaitUntilApplied supplies wrong epoch for executeAtEpoch
aweisberg Jun 6, 2024
5af655b
CEP-15: (Accord) SyncPoint timeouts become a Exhausted rather than a …
dcapwell Jun 18, 2024
c578c82
Introduce Periodic mode to Accord Journal
belliottsmith May 23, 2024
4d93ad6
CEP-15: (Accord) When nodes are removed from a cluster, need to updat…
dcapwell Jun 18, 2024
4497253
Bring back Journal simulator (w/o Accord at least for now); add semap…
ifesdjeen Jun 5, 2024
534af5a
CEP-15 (Accord): When starting a transaction in a table where Accord …
stonewhitener Jul 23, 2024
66c9007
Accord Journal / Determinism
ifesdjeen Jun 12, 2024
8e43139
CommandsForKey Improvements incl Pruning
belliottsmith Jul 18, 2024
22fa0c1
CASSANDRA-19825: Fix various bugs and abstraction deficiencies, inclu…
belliottsmith Aug 2, 2024
b0d3b4b
Accord migration and interop correctness
aweisberg Mar 18, 2024
f7aaede
CommandsForRanges does not support slice which cause over returned da…
dcapwell Aug 23, 2024
081669e
Add an ability to reconstruct arbitrary epoch state from the log to TCM
ifesdjeen Jul 19, 2024
55714b8
Revert acccord module to absolute path
ifesdjeen Aug 26, 2024
e990d25
Switch to infinite loop executor instead of a while-loop thread.
ifesdjeen Aug 26, 2024
30357e8
Add size to the segment index for safer journal reads
ifesdjeen Jul 22, 2024
bc93cd3
txns that update a static row when the desired row doesn't exist lead…
dcapwell Aug 29, 2024
c242971
Switch to streaming serialization of SavedCommand
ifesdjeen Aug 28, 2024
aea01e8
Command to Exclude Replicas from Durability Status Coordination
maedhroz Jul 16, 2024
048105d
Add a table to inspect the current state of a txn
dcapwell Aug 16, 2024
d4e2867
Create a fuzz test that randomizes topology changes, cluster actions,…
dcapwell Aug 30, 2024
0a7c253
Fix a problem with static segments being opened with an empty offset …
ifesdjeen Aug 26, 2024
6d0a406
Fix Journal segment allocation/switch race condition
ifesdjeen Sep 9, 2024
f206f58
Redesign progress mechanisms to be memory efficient, use fewer messag…
belliottsmith Aug 22, 2024
9ad574a
Journal segment compaction
ifesdjeen Aug 22, 2024
f2c4e77
CEP-15 (C*) increase message timeouts for range barrier messages
bdeggleston Aug 26, 2024
032cf13
CEP-15: C* - Early repair failures hang nodetool
bdeggleston Aug 13, 2024
ec4c923
Rebase fixup: SerializationsTest needed to recreate the service.SyncC…
dcapwell Sep 17, 2024
d3e241d
Ninja fix: RandomSource.asJdkRandom did not provide a seed. This sho…
dcapwell Sep 17, 2024
21ba951
Rebase fixup: Accord should follow the pattern and use requestTime.co…
dcapwell Sep 18, 2024
1f06ebd
CEP-15 (C*): Read accord repair cfk keys from sstable index.
bdeggleston Sep 20, 2024
13a37f4
CEP-15 (C*) - misc accord perf improvements
bdeggleston Sep 9, 2024
0462ca0
This commits contains the following two patches in order to reduce th…
dcapwell Jun 18, 2024
3e3018f
Change MaxConflicts to use a BTree under the hood
iamaleksey Sep 28, 2024
4bbb962
ninja: handle serialization of truncated accept responses
bdeggleston Sep 28, 2024
c2fbb42
Implement Journal replay on startup:
ifesdjeen Sep 12, 2024
f23cb63
CASSANDRA-19967: Refine epoch quorum intersections, sync points, conf…
belliottsmith Sep 22, 2024
71e9238
improve AccordLoadTest to support more keys
belliottsmith Sep 30, 2024
625b0d9
Ninja: Repin accord
ifesdjeen Sep 30, 2024
7172da5
Add purging to Accord Journal table
ifesdjeen Sep 30, 2024
540e20d
Support Restart node in Accord
dcapwell Sep 30, 2024
c5583a1
ninja: fix CFK serializer
belliottsmith Sep 30, 2024
383fb94
ninja: Fix AcceptSerializer
aweisberg Oct 1, 2024
36ccd1d
Follow-up to CASSANDRA-19967 and CASSANDRA-19869
ifesdjeen Oct 1, 2024
f797878
Accord: Share DurableBefore between CommandStores
belliottsmith Oct 3, 2024
10c6ba1
ninja: increase durability scheduling delays
belliottsmith Oct 3, 2024
6fa27dc
visit journal backwards to save time parsing
belliottsmith Oct 4, 2024
4db862a
Fix condition on where we shut down accord; move scheduled executor s…
ifesdjeen Oct 4, 2024
20e67bd
ExclusiveSyncPoints should always wait for a simple quorum
belliottsmith Oct 5, 2024
f71aa0a
Halve cache memory consumption by not retaining 'original' to diff; d…
belliottsmith Oct 10, 2024
21fa537
Enable and test purging
belliottsmith Oct 10, 2024
ca127c1
Journal diff serialization: validateFlags and WaitingOn size
belliottsmith Oct 10, 2024
789211b
Fix truncatedApply deserialization
belliottsmith Oct 10, 2024
a585835
Ninja: fast path now updates after 60s rather than 5s. Added toStrin…
dcapwell Oct 11, 2024
09723ef
Follow-up to: Do not contact faulty replicas, and support reporting s…
belliottsmith Oct 11, 2024
cde53cd
Ninja: fast path now updates after 3600s rather than 60s.
belliottsmith Oct 11, 2024
2b5d452
increase timeout for CalculateDepsReq
belliottsmith Oct 11, 2024
d26867f
disable TableId interning
belliottsmith Oct 11, 2024
b395be2
do not schedule additional durability attempts while some in flight; …
belliottsmith Oct 11, 2024
d03ba33
Store historical transactions per epoch
belliottsmith Oct 11, 2024
f3b7362
AccordJournalPurger should use shouldCleanupPartial
belliottsmith Oct 14, 2024
91da288
load historical transactions when loading topology
belliottsmith Oct 15, 2024
6bbf99d
Add bounce to load test
ifesdjeen Oct 5, 2024
8226590
Accord should not block partition restricted index queries
aweisberg Sep 24, 2024
59dd0b6
Shut down scheduler with "now"
ifesdjeen Oct 21, 2024
3e02b51
Fix CASTest
ifesdjeen Oct 2, 2024
0cf0aab
Accord metrics are isolated which cause existing coordination metrics…
dcapwell Oct 22, 2024
771a6f6
Accord should block currently unsafe operations
dcapwell Oct 23, 2024
1ad3651
TopologyMixupTestBase does not fix replication factor for Keyspaces a…
dcapwell Oct 2, 2024
8cda9c9
Check for splittable ranges
ifesdjeen Oct 23, 2024
b5542df
Accord Deps tests have incorrect range semantics
dcapwell Oct 25, 2024
4f83c75
Use ExclusiveSyncPoints to join a new topology
belliottsmith Oct 11, 2024
f45daf5
Get Harry working on top of Accord and fix various issues found by To…
dcapwell Oct 28, 2024
724bced
Miscellaneous migration test fixes
aweisberg Oct 24, 2024
b5faeae
Improvements to queueing, execution and performance
belliottsmith Oct 17, 2024
a5dd6f9
Accord's ConfigService lock is held over large areas which cause dead…
dcapwell Oct 17, 2024
ba5b597
Split accord migration into two phases
aweisberg Jul 17, 2024
80854d8
Implement missing virtual tables for Accord debugging
iamaleksey Oct 24, 2024
c9d4ffb
Non-serial reads and range reads without live migration support
aweisberg Jul 23, 2024
6ed6f2e
Set Accord debug tables partitioner to LocalPartitioner
iamaleksey Nov 18, 2024
4c86dd7
Fix AbstractKeys.without (and CoordinateEphemeralRead execution in f…
belliottsmith Nov 12, 2024
b991305
Key transaction recovery should witness range transactions
belliottsmith Nov 11, 2024
885fd71
Accord: Fix unit tests and improve burn test stability
belliottsmith Nov 19, 2024
c4aaa72
Make it easier to reuse generators, make Harry more extensible and ac…
ifesdjeen Nov 8, 2024
eb80e7e
Fix restartWithEpochChanges test; make CMS nodes first gossip with CM…
ifesdjeen Nov 29, 2024
b8caf08
Semi integrate burn test:
ifesdjeen Nov 15, 2024
08612da
Fix infinite loop, and notify progress log of sync point durability w…
belliottsmith Dec 2, 2024
6076428
Accord simulation test failing with "ClassNotFoundException: WARN [A…
dcapwell Dec 4, 2024
75edf65
TCM's Retry.Deadline#retryIndefinitely is dangerous if used with Remo…
dcapwell Dec 9, 2024
6f96365
Implement field saving/loading in AccordJournal
ifesdjeen Nov 26, 2024
0a58b04
Fix Accord SAI tests and Accord double apply
aweisberg Nov 14, 2024
4f4478c
Fixes
belliottsmith Dec 15, 2024
05c0927
Remove TimestampsForKey
belliottsmith Nov 28, 2024
bb28f9f
Migrate in memory journal to CommandChange logic shared with AccordJo…
ifesdjeen Nov 26, 2024
c311dcf
Refactor the ast package to enable harry model based testing
dcapwell Jan 13, 2025
7fbaf38
Fix topology replay during bootstrap and startup, decouple Accord fro…
ifesdjeen Dec 5, 2024
4941180
FetchRequest should report as unavailable any slice that executes in …
belliottsmith Jan 5, 2025
87cccbb
Fix problem with iteration order in AccordJournal
ifesdjeen Jan 15, 2025
64bce37
Fix serialization order for topology updates
ifesdjeen Jan 15, 2025
fc25cbb
Fix CoordinatorReadLatencyMetricTest
ifesdjeen Jan 16, 2025
35d4947
Fix ForceSnapshotTest
ifesdjeen Jan 17, 2025
91788ef
Protocol optimisations:
belliottsmith Jan 8, 2025
224842c
Migrate route index from commands table to journal, and drop the comm…
dcapwell Dec 10, 2024
ab2a8d4
Remove Journal record ownership tags functionality
iamaleksey Jan 15, 2025
aeee9a5
Fix deps serializers
ifesdjeen Jan 21, 2025
08c06d6
Fix Simulator Tests
ifesdjeen Jan 20, 2025
cef93da
Fix race condition in AccordExecutor#cancelExclusive
ifesdjeen Jan 21, 2025
9156bdc
Agree a distributed uniqueHlc to use for Apply
belliottsmith Jan 18, 2025
6420f00
Fix "modifiers" missing field exception on JDK17
ifesdjeen Jan 23, 2025
914c08f
Fix testClearSnapshot_RemoveMultiple
ifesdjeen Jan 23, 2025
5259330
Follow-up to CASSANDRA-20228:
belliottsmith Jan 27, 2025
72d6963
Fix empty LatestDepsSerializer
ifesdjeen Jan 28, 2025
dd667f0
Live migration for non-serial reads
aweisberg Oct 2, 2024
9242bbb
Fix ShortAccordSimulationTest
aweisberg Jan 30, 2025
14d6bb9
Fix paging with Accord range reads
aweisberg Jan 30, 2025
7c490c2
Fix TxnNamedRead discarding paging state
aweisberg Jan 30, 2025
e13146a
Follow-up to CASSANDRA-20222:
belliottsmith Jan 30, 2025
fdd6d45
To improve accord interoperability test coverage, need to extend the …
dcapwell Feb 1, 2025
4d66a94
Improve topology fetching
ifesdjeen Jan 27, 2025
5162426
Refactor RedundantStatus to encode vector of states that can be merge…
belliottsmith Feb 1, 2025
be616c2
When generating AbstractTypeGenerators.safeTypeGen() for tests compos…
dcapwell Feb 3, 2025
03586d7
Accord: jvm-dtest changed semantics of uncaughtExceptions handling wh…
dcapwell Feb 4, 2025
8b2b043
Avoid double loading in Cassandra side of journal; make sure to inclu…
ifesdjeen Jan 22, 2025
ff9817e
Fix:
belliottsmith Feb 5, 2025
fcf941d
Add @Ignore to failing tests while we triage
belliottsmith Feb 5, 2025
5c8f9cd
Fixed an issue where table walk and token conflict mutations would us…
dcapwell Feb 6, 2025
81b3b26
Accord: TableParamsTest is flakey due to bad generators and productio…
dcapwell Feb 6, 2025
eaecfb5
Fix topology loading
ifesdjeen Feb 3, 2025
fc52271
Fix null field accounting
ifesdjeen Feb 5, 2025
cbc89c3
Expose epoch ready state as a vtable for operators to inspect things
dcapwell Feb 12, 2025
d7d5082
Fix flakey test org.apache.cassandra.simulator.test.ShortPaxosSimulat…
dcapwell Feb 12, 2025
66335ff
(Accord) Fix recovery when one shard is committed/stable and another …
belliottsmith Feb 13, 2025
1e264a5
Fix AccordMigrationTest, preclude possible races in topology propagation
ifesdjeen Feb 7, 2025
12657d3
Improve stability of tests with many epochs
ifesdjeen Feb 21, 2025
39c3f78
Accord: Serialization Improvements
belliottsmith Feb 15, 2025
6341d98
Fix:
belliottsmith Feb 19, 2025
4b23a1d
Accord fixes:
belliottsmith Feb 26, 2025
7b6bc62
Integrate RX with Cassandra Repair, so that repair safely flushes pen…
belliottsmith Feb 3, 2025
6850eb1
Add initial Accord Overview Doc
ifesdjeen Mar 4, 2025
0d557af
InterceptingExecutor.schedule returns a simulator-unsafe Future
belliottsmith Mar 8, 2025
401009f
When bootstrap fails the retry field is not populated which leads to …
dcapwell Mar 8, 2025
f941823
Epoch/Topology Garbage Collection
ifesdjeen Feb 19, 2025
7e86999
Implement Nemesis compactor, improve partial compaction
ifesdjeen Mar 6, 2025
825acec
Topology mixup tests should do repairs for host replacement and other…
dcapwell Mar 10, 2025
48515fe
Fix:
belliottsmith Mar 3, 2025
336404c
Accord repin: turn pruning back on
ifesdjeen Mar 12, 2025
30a458e
Decouple Accord serializers from C* message version so accord can mak…
dcapwell Mar 13, 2025
0d30627
Fix:
belliottsmith Mar 13, 2025
297a424
Accord: test fixes and stability improvements
ifesdjeen Mar 11, 2025
de9925f
fixing post-rebase checkstyle problems
maedhroz Apr 1, 2025
37ef88f
Switch to plain Thread for AccordExecutor, and improve testing for AS…
belliottsmith Mar 15, 2025
e0dc2fc
Fix CQLSSTableWriterConcurrencyTest
belliottsmith Apr 4, 2025
bc16318
Fix upgrade TTL tests that fail due to improved error detection in ce…
dcapwell Apr 7, 2025
9f5f692
Fix tests
belliottsmith Apr 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
45 changes: 45 additions & 0 deletions .build/build-accord.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project basedir=".." name="apache-cassandra-accord-build"
xmlns:if="ant:if">
<target name="_build-accord" depends="init">
<exec executable="${basedir}/${accord.dir}/gradlew" dir="${basedir}/${accord.dir}" logError="true" failonerror="true" failifexecutionfails="true">
<!-- Need to call clean as a version change with a jar that didn't have code changes will not produce a new jar with the new version... so need clean to make sure build is stable -->
<arg value="clean" />
<arg value="build" />
<arg value="copyDependencies" /> <!-- For IDE support -->
<arg value="publishToMavenLocal" />
<arg value="-x" />
<arg value="test" />
<!-- since so much development is done from this hook, by adding checkstyle and rat will avoid issues earlier -->
<arg value="rat" />
<arg value="checkstyleMain" />
<arg value="checkstyleTest" />
<arg value="-Paccord_group=org.apache.cassandra" />
<arg value="-Paccord_artifactId=cassandra-accord" />
<arg value="-Paccord_version=${version}" />
</exec>
<!-- when dependencies are copied into the build dir they may be ignored if already present, so cleanup to pick up latest changes -->
<delete>
<!-- Why does this not use ${build.dir.lib}/jar and ${test.lib}/jar? The reason is that filesets never finds files in that case -->
<!-- To handle the case that build or lib dirs do not exist yet, had to push the logic into includes, other solution was to create a task and use if conditions there -->
<fileset dir="${basedir}" includes="build/lib/jars/cassandra-accord-*.jar,build/test/lib/jars/cassandra-accord-*.jar" />
</delete>
</target>
</project>
4 changes: 2 additions & 2 deletions .build/build-checkstyle.xml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
<project basedir="." name="apache-cassandra-checkstyle"
xmlns:rat="antlib:org.apache.rat.anttasks">

<target name="init-checkstyle" depends="resolver-retrieve-build,build-project" unless="no-checkstyle">
<target name="init-checkstyle" depends="resolver-retrieve-build,_build_subprojects,build-project" unless="no-checkstyle">
<path id="checkstyle.lib.path">
<fileset dir="${test.lib}/jars" includes="*.jar"/>
</path>
@@ -45,7 +45,7 @@
</checkstyle>
</target>

<target name="checkstyle-test" depends="init-checkstyle,resolver-retrieve-build,build-project" description="Run custom checkstyle code analysis on tests" unless="no-checkstyle">
<target name="checkstyle-test" depends="init-checkstyle,resolver-retrieve-build,_build_subprojects,build-project" description="Run custom checkstyle code analysis on tests" unless="no-checkstyle">
<property name="checkstyle.log.dir" value="${build.dir}/checkstyle" />
<property name="checkstyle_test.report.file" value="${checkstyle.log.dir}/checkstyle_report_test.xml"/>
<mkdir dir="${checkstyle.log.dir}" />
1 change: 1 addition & 0 deletions .build/build-rat.xml
Original file line number Diff line number Diff line change
@@ -78,6 +78,7 @@
<exclude NAME="CHANGES.txt"/>
<exclude NAME="CASSANDRA-14092.txt"/>
<exclude NAME="debian/TODO"/>
<exclude NAME="accord_demo.txt"/>
<!-- legal files -->
<exclude NAME="NOTICE.txt"/>
<exclude NAME="LICENSE.txt"/>
4 changes: 2 additions & 2 deletions .build/build-resolver.xml
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@
<property name="resolver-ant-tasks.initialized" value="true"/>
</target>

<target name="resolver-retrieve-build" depends="resolver-init,write-poms">
<target name="resolver-retrieve-build" depends="resolver-init,write-poms,_build_subprojects">
<resolvepom file="${build.dir}/${final.name}.pom" id="all-pom" />
<resolvepom file="${build.dir}/tmp-${final.name}-deps.pom" id="pom-deps" />

@@ -206,7 +206,7 @@
</unzip>
</target>

<target name="resolver-dist-lib" depends="resolver-retrieve-build">
<target name="resolver-dist-lib" depends="resolver-retrieve-build,_build_subprojects">
<resolvepom file="${build.dir}/${final.name}.pom" id="all-pom" />

<retry retrycount="3" retrydelay="10" >
5 changes: 5 additions & 0 deletions .build/cassandra-build-deps-template.xml
Original file line number Diff line number Diff line change
@@ -155,5 +155,10 @@
<groupId>org.bouncycastle</groupId>
<artifactId>bcutil-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-accord</artifactId>
<classifier>tests</classifier>
</dependency>
</dependencies>
</project>
4 changes: 4 additions & 0 deletions .build/cassandra-deps-template.xml
Original file line number Diff line number Diff line change
@@ -116,6 +116,10 @@
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-accord</artifactId>
</dependency>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>airline</artifactId>
1 change: 0 additions & 1 deletion .build/checkstyle_suppressions.xml
Original file line number Diff line number Diff line change
@@ -21,5 +21,4 @@
"https://checkstyle.org/dtds/suppressions_1_1.dtd">

<suppressions>
<suppress checks="RegexpSinglelineJava" files="Semaphore\.java"/>
</suppressions>
41 changes: 41 additions & 0 deletions .build/git/git-hooks/post-checkout/100-update-submodules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Redirect output to stderr.
exec 1>&2

#set -o xtrace
set -o errexit
set -o pipefail
set -o nounset

bin="$(cd "$(dirname "$0")" > /dev/null; pwd)"

_main() {
# In case the usage happens at a different layer, make sure to cd to the toplevel
local root_dir
root_dir="$(git rev-parse --show-toplevel)"
cd "$root_dir"

if [[ ! -e .gitmodules ]]; then
# nothing to see here, look away!
return 0
fi
git submodule update --init --recursive
}

_main "$@"
1 change: 1 addition & 0 deletions .build/git/git-hooks/post-switch
98 changes: 98 additions & 0 deletions .build/git/git-hooks/pre-commit/100-verify-submodules-pushed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

##
## When working with submodules the top level project (Apache Cassandra) needs to commit all submodule
## changes so the top level knows what SHA to use. When working in a development environment it is
## common that multiple commits will exist in both projects, if the submodule has its history
## rewritten, then historic top level commits are no longer valid unless the SHAs are pushed to a
## remote repo; this is what the script attempts to do, make sure all SHAs added to the
## Apache Cassandra are backed up to a remote repo to make the Cassandra SHA buildable.
##

# Redirect output to stderr.
exec 1>&2


#set -o xtrace
set -o errexit
set -o pipefail
set -o nounset

bin="$(cd "$(dirname "$0")" > /dev/null; pwd)"

_log() {
echo -e "[pre-commit]\t$*"
}

error() {
_log "$@" 1>&2
exit 1
}

# Status Table
# A Added
# C Copied
# D Deleted
# M Modified
# R Renamed
# T Type Changed (i.e. regular file, symlink, submodule, …<200b>)
# U Unmerged
# X Unknown
# B Broken
_main() {
# In case the usage happens at a different layer, make sure to cd to the toplevel
local root_dir
root_dir="$(git rev-parse --show-toplevel)"
cd "$root_dir"

[[ ! -e .gitmodules ]] && return 0
local enabled=$(git config --bool cassandra.pre-commit.verify-submodules.enabled || echo true)
[ "$enabled" == "false" ] && return 0
local submodules=( $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }') )

local is_submodule=false
local git_sub_dir
local git_sha
while read status file; do
is_submodule=false
for to_check in "${submodules[*]}"; do
if [[ "$to_check" == "$file" ]]; then
is_submodule=true
break
fi
done
if $is_submodule; then
local enabled=$(git config --bool cassandra.pre-commit.verify-submodule-${file}.enabled || echo true)
[ "$enabled" == "false" ] && continue
_log "Submodule detected: ${file} with status ${status}; attempting a push"
_log "\tTo disable pushes, run"
_log "\t\tgit config --local cassandra.pre-commit.verify-submodules.enabled false"
_log "\tOr"
_log "\t\tgit config --local cassandra.pre-commit.verify-submodule-${file}.enabled false"
git_sub_dir="${file}/.git"
branch="$(git config -f .gitmodules "submodule.${file}.branch")"
[[ -z "${branch:-}" ]] && error "Submodule ${file} does not define a branch"
git_sha="$(git --git-dir "${git_sub_dir}" rev-parse HEAD)"
local remote="$(git --git-dir "${git_sub_dir}" config --get "branch.${branch}.remote" || error "Git branch ${branch} is not set up to track any remote in submodule ${file}")"
git --git-dir "${git_sub_dir}" fetch "${remote}"
git --git-dir "${git_sub_dir}" branch "${remote}/${branch}" --contains "${git_sha}" || error "Git commit ${git_sha} not found in $(git remote get-url "${remote}") on branch ${branch}"
fi
done < <(git diff --cached --name-status)
}

_main "$@"
116 changes: 116 additions & 0 deletions .build/git/install-git-defaults.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#set -o xtrace
set -o errexit
set -o pipefail
set -o nounset

bin="$(cd "$(dirname "$0")" > /dev/null; pwd)"

install_template_script() {
local -r name="$1"
local -r d_dir="$2"

cat <<EOF > "$name"
#!/usr/bin/env bash

# This script is autogenerated by the Apache Cassandra build; DO NOT CHANGE!
# When this script is not found it will be installed automatically by the build
# If an existing script is found, that script will be reloated under ${d_dir} as 000-original.sh

# Redirect output to stderr.
exec 1>&2

# Find all scripts to run
for path in \$(find "$d_dir" -name '*.sh' | perl -e "print sort{(split '/', \\\$a)[-1] <=> (split '/', \\\$b)[-1]}<>"); do
"\$path" "\$@"
done
EOF
chmod a+x "$name"
}

install_hook() {
local -r git_dir="$1"
local -r hooks_dir="${git_dir}/hooks"
local -r name="$2"
local -r d_dir="${hooks_dir}/${name}.d"
local -r trigger_on_install=$3

mkdir "${d_dir}" &> /dev/null || true
local -r script_name="${hooks_dir}/${name}"
local installed=true
if [[ -e "$script_name" ]]; then
# was the script already installed?
if ! grep "This script is autogenerated by the Apache Cassandra build" "$script_name" &> /dev/null ; then
echo "$script_name found, but was not generated by the Apache Cassandra build; please remove or move to ${d_dir}/000-original.sh; creating and moving to ${d_dir} will cause it to run as expected, but won't conflict with hooks this build adds" 1>&2
exit 1
else
installed=false
fi
fi
# install all hooks
cp "$bin"/git-hooks/"${name}"/* "$d_dir"/

# install coordinator hook
install_template_script "$script_name" "$d_dir"
if $installed && $trigger_on_install ; then
echo "Running script $script_name"
"$script_name"
fi
}

_install_hooks() {
local git_dir
# make sure to use --git-common-dir and not --git-dir to support worktrees
git_dir="$(git rev-parse --git-common-dir 2> /dev/null || true)"
if [[ -z "${git_dir:-}" ]]; then
# not in a git repo, noop
return 0
fi

# make sure hooks directory exists; does not exist by default for worktrees
mkdir -p "${git_dir}/hooks" &> /dev/null || true

install_hook "$git_dir" "post-checkout" true
install_hook "$git_dir" "post-switch" false
install_hook "$git_dir" "pre-commit" false
}

_git_config_set() {
local -r name="$1"
# only care about rc
git config --local --get "$name" &> /dev/null
}

_install_configs() {
# when doing pull, this makes sure submodules are updated
_git_config_set submodule.recurse || git config --local submodule.recurse true
}

_main() {
local git_dir
# make sure to use --git-common-dir and not --git-dir to support worktrees
git_dir="$(git rev-parse --git-common-dir 2> /dev/null || true)"
# not in a git repo, noop
[[ -z "${git_dir:-}" ]] && return 0

_install_configs
_install_hooks
}

_main "$@"
Loading