@@ -2679,9 +2679,9 @@ test_sample_causal_consistency (mongoc_client_t *client)
2679
2679
goto cleanup ;
2680
2680
}
2681
2681
2682
- /* Example 1:
2683
- * ----------
2684
- * Use a causally-consistent session to run some operations. */
2682
+ /* Start Causal Consistency Example 1 */
2683
+
2684
+ / * Use a causally-consistent session to run some operations. */
2685
2685
2686
2686
wc = mongoc_write_concern_new ();
2687
2687
mongoc_write_concern_set_wmajority (wc , 1000 );
@@ -2700,7 +2700,7 @@ test_sample_causal_consistency (mongoc_client_t *client)
2700
2700
goto cleanup ;
2701
2701
}
2702
2702
2703
- /* Run an update_one with our causally-consistent session */
2703
+ /* Run an update_one with our causally-consistent session. */
2704
2704
update_opts = bson_new ();
2705
2705
res = mongoc_client_session_append (session1 , update_opts , & error );
2706
2706
if (!res ) {
@@ -2739,11 +2739,12 @@ test_sample_causal_consistency (mongoc_client_t *client)
2739
2739
goto cleanup ;
2740
2740
}
2741
2741
2742
- /* Example 2:
2743
- * ----------
2744
- * Make a new session, session2, and make it causally-consistent
2745
- * with session1, so that session2 will read session1's writes. */
2742
+ /* End Causal Consistency Example 1 */
2743
+
2744
+ /* Start Causal Consistency Example 2 */
2746
2745
2746
+ /* Make a new session, session2, and make it causally-consistent
2747
+ * with session1, so that session2 will read session1's writes. */
2747
2748
session2 = mongoc_client_start_session (client , session_opts , & error );
2748
2749
if (!session2 ) {
2749
2750
fprintf (stderr , "couldn't start session: %s\n" , error .message );
@@ -2787,6 +2788,8 @@ test_sample_causal_consistency (mongoc_client_t *client)
2787
2788
goto cleanup ;
2788
2789
}
2789
2790
2791
+ /* End Causal Consistency Example 2 */
2792
+
2790
2793
cleanup :
2791
2794
2792
2795
bson_destroy (doc );
0 commit comments