Jekyll2020-08-03T13:19:59+01:00https://tvale.github.io/feed.xmlTiago ValeThe personal webiste of Tiago Vale.Tiago ValeI left MySQL, Oracle, and joined MemSQL2020-08-03T00:00:00+01:002020-08-03T00:00:00+01:00https://tvale.github.io/memsql<p>As of today I’m a Senior Software Engineer at <a href="https://www.memsql.com">MemSQL</a>, working on the <a href="https://www.memsql.com/careers/engineering/#teams">Engine Engineering</a> team.</p>
<p>Previously I was a Software Engineer at <a href="https://www.mysql.com">MySQL</a>, <a href="https://www.oracle.com">Oracle</a>, working on the <a href="https://www.mysqlhighavailability.com">Replication team</a>.
Most of the time I worked on the <a href="https://en.wikipedia.org/wiki/Paxos_(computer_science)">Paxos</a>-based <a href="https://dev.mysql.com/doc/refman/8.0/en/group-replication-plugin-architecture.html">group communication engine</a> that powers <a href="https://dev.mysql.com/doc/refman/8.0/en/group-replication.html">MySQL Group Replication</a>.<br />
I had a wonderful experience at MySQL. I learned a lot during my time there, and I truly believe our relationship was mutually benefitial. I’m thankful for having worked there, and I wish everyone the best!</p>Tiago ValeAs of today I’m a Senior Software Engineer at MemSQL, working on the Engine Engineering team.Trace the history of a function using git2020-01-31T00:00:00+00:002020-01-31T00:00:00+00:00https://tvale.github.io/trace-history-of-function-using-git<p class="notice--primary">tl;dr: <code>git log -L :funcname:file</code></p>
<p>Recently I had the need to know which commit in a <a href="https://git-scm.org">git</a> repository introduced a certain change to some function’s logic.</p>
<p>I already knew how to see the change history of an entire file using <code class="language-plaintext highlighter-rouge">git log --patch -- <file></code>.
However, there was a lot of history and the file was big, so <code class="language-plaintext highlighter-rouge">git log</code> generated lots of output I did not care for.</p>
<p>I wondered if it was possible to only see the change history of some function in a file instead of the entire file’s.
Guess what, it is possible: <a href="https://www.git-scm.com/docs/git-log#Documentation/git-log.txt--Lltfuncnamegtltfilegt"><code class="language-plaintext highlighter-rouge">git log -L :funcname:file</code></a>.</p>
<h3 id="example">Example</h3>
<p>Let us look at a simple example. Consider we have the following source code in the file <code class="language-plaintext highlighter-rouge">example.c</code>:</p>
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="nf">a_function</span><span class="p">(</span><span class="kt">double</span> <span class="n">a_parameter</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// I wish I was special</span>
<span class="c1">// So very special</span>
<span class="c1">// But I'm a function</span>
<span class="p">}</span>
<span class="kt">int</span> <span class="nf">some_function</span><span class="p">(</span><span class="kt">int</span> <span class="n">some_parameter</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// Do stuff to the parameters</span>
<span class="p">}</span>
<span class="kt">void</span> <span class="nf">our_function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1">// I'm your function</span>
<span class="c1">// Here I am</span>
<span class="c1">// This is me</span>
<span class="p">}</span>
<span class="kt">double</span> <span class="nf">some_other_function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1">// I am also here</span>
<span class="p">}</span>
</code></pre></div></div>
<p>Now consider that we made some commits with changes to <code class="language-plaintext highlighter-rouge">example.c</code>.
For example, here is our hypothetical history of the changes to <code class="language-plaintext highlighter-rouge">example.c</code> in chronological order, courtesy of <code class="language-plaintext highlighter-rouge">git log --patch --reverse -- example.c</code>:<sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup></p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="err">$</span> git log --patch --reverse -- example.c
<span class="p">commit dc74fc966e1abaf5ff9b5c2763b59f82b917f190
Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:03 2038 +0000
</span>
Add example.c
diff --git a/example.c b/example.c
<span class="p">new file mode 100644
</span><span class="gh">index 0000000..d44971c
</span><span class="gd">--- /dev/null
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -0,0 +1,19 @@</span>
<span class="gi">+void a_function(double a_parameter) {
+ // I wish I was special
+ // So very special
+ // But I'm a function
+}
+
+int some_function(int some_parameter) {
+ // Do stuff to the parameters
+}
+
+void our_function() {
+ // I'm your function
+ // Here I am
+ // This is me
+}
+
+double some_other_function() {
+ // I am also here
+}
</span>
commit 3851c5f09f8c73859dc0b5feed90677e58e61f97
<span class="p">Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:04 2038 +0000
</span>
Change our_function
diff --git a/example.c b/example.c
<span class="gh">index d44971c..e14a2cf 100644
</span><span class="gd">--- a/example.c
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -10,8 +10,7 @@</span> int some_function(int some_parameter) {
void our_function() {
// I'm your function
<span class="gd">- // Here I am
- // This is me
</span><span class="gi">+ // And I'm going through changes
</span> }
double some_other_function() {
commit f3373bc8b9bf64c0af4eb6349a4e9789a5721389
<span class="p">Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:05 2038 +0000
</span>
Change a_function
diff --git a/example.c b/example.c
<span class="gh">index e14a2cf..3d16bc9 100644
</span><span class="gd">--- a/example.c
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -2,6 +2,8 @@</span> void a_function(double a_parameter) {
// I wish I was special
// So very special
// But I'm a function
<span class="gi">+ // This guy is a weirdo
+ // What the hell am I doing here
</span> }
int some_function(int some_parameter) {
commit d82c3535871fd47ee7bcb0b0f6ff9f5dd30fa6fb
<span class="p">Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:06 2038 +0000
</span>
Change some_function and some_other_function
diff --git a/example.c b/example.c
<span class="gh">index 3d16bc9..dac2191 100644
</span><span class="gd">--- a/example.c
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -8,6 +8,7 @@</span> void a_function(double a_parameter) {
int some_function(int some_parameter) {
// Do stuff to the parameters
<span class="gi">+ // Return the stuff done to the parameters
</span> }
void our_function() {
<span class="p">@@ -17,4 +18,5 @@</span> void our_function() {
double some_other_function() {
// I am also here
<span class="gi">+ // Thanks for acknowledging me
</span> }
commit dde094c8f47c4f7bfa7176e25653120178aaad51
<span class="p">Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:07 2038 +0000
</span>
Change a_function and our_function
diff --git a/example.c b/example.c
<span class="gh">index dac2191..f437330 100644
</span><span class="gd">--- a/example.c
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -4,6 +4,7 @@</span> void a_function(double a_parameter) {
// But I'm a function
// This guy is a weirdo
// What the hell am I doing here
<span class="gi">+ // I don't belong here
</span> }
int some_function(int some_parameter) {
<span class="p">@@ -14,6 +15,7 @@</span> int some_function(int some_parameter) {
void our_function() {
// I'm your function
// And I'm going through changes
<span class="gi">+ // So long and thanks for all the changes
</span> }
double some_other_function() {
</code></pre></div></div>
<p>Now let us image we are interested in seeing the evolution of <code class="language-plaintext highlighter-rouge">our_function()</code>.
Some commits change <code class="language-plaintext highlighter-rouge">our_function()</code> and some do not.
This is a lot of output we do not care about.
Here comes the <code class="language-plaintext highlighter-rouge">-L</code> parameter to the rescue, <code class="language-plaintext highlighter-rouge">git log -L :our_function:example.c --reverse</code>:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="err">$</span> git log -L :our_function:example.c --reverse
<span class="p">commit dc74fc966e1abaf5ff9b5c2763b59f82b917f190
Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:03 2038 +0000
</span>
Add example.c
diff --git a/example.c b/example.c
<span class="gd">--- /dev/null
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -0,0 +11,6 @@</span>
<span class="gi">+void our_function() {
+ // I'm your function
+ // Here I am
+ // This is me
+}
+
</span>
commit 3851c5f09f8c73859dc0b5feed90677e58e61f97
<span class="p">Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:04 2038 +0000
</span>
Change our_function
diff --git a/example.c b/example.c
<span class="gd">--- a/example.c
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -11,6 +11,5 @@</span>
void our_function() {
// I'm your function
<span class="gd">- // Here I am
- // This is me
</span><span class="gi">+ // And I'm going through changes
</span> }
commit dde094c8f47c4f7bfa7176e25653120178aaad51
<span class="p">Author: John Doe <john.doe@domain.com>
Date: Tue Jan 19 03:14:07 2038 +0000
</span>
Change a_function and our_function
diff --git a/example.c b/example.c
<span class="gd">--- a/example.c
</span><span class="gi">+++ b/example.c
</span><span class="p">@@ -14,5 +15,6 @@</span>
void our_function() {
// I'm your function
// And I'm going through changes
<span class="gi">+ // So long and thanks for all the changes
</span> }
</code></pre></div></div>
<p>Boom! Thanks git. :-)</p>
<div class="footnotes">
<ol>
<li id="fn:1">
<p><code class="language-plaintext highlighter-rouge">--patch</code> shows the patch in the log, and <code class="language-plaintext highlighter-rouge">--reverse</code> shows the log in chronological order. <a href="#fnref:1" class="reversefootnote">↩</a></p>
</li>
</ol>
</div>Tiago Valetl;dr: git log -L :funcname:fileI earned my Ph.D.2019-05-03T00:00:00+01:002019-05-03T00:00:00+01:00https://tvale.github.io/phd<p>Today I earned by Ph.D. in Computer Science from Universidade Nova de Lisboa.<br />
You can find the dissertation <a href="https://run.unl.pt/bitstream/10362/71218/1/Vale_2019.pdf">here</a> and the slides <a href="https://speakerdeck.com/tvale/executing-requests-concurrently-in-state-machine-replication">here</a>.</p>Tiago ValeToday I earned by Ph.D. in Computer Science from Universidade Nova de Lisboa. You can find the dissertation here and the slides here.I gave a talk at the 2019 pre-FOSDEM MySQL day2019-02-01T00:00:00+00:002019-02-01T00:00:00+00:00https://tvale.github.io/prefosdem-mysql-day-2019<p>Today I presented “8 MySQL Group Replication features that will make you smile” at the <a href="https://lefred.be/content/friday-feb-1st-it-is-mysql-day/">2019 pre-FOSDEM MySQL day</a>.
You can find the slides <a href="https://speakerdeck.com/tvale/8-group-replication-features-that-will-make-you-smile">here</a>.</p>Tiago ValeToday I presented “8 MySQL Group Replication features that will make you smile” at the 2019 pre-FOSDEM MySQL day. You can find the slides here.I joined MySQL2017-11-06T00:00:00+00:002017-11-06T00:00:00+00:00https://tvale.github.io/mysql<p>As of today I’m a Software Engineer at <a href="https://www.oracle.com">Oracle</a>, working on the <a href="https://www.mysql.com">MySQL</a> <a href="https://www.mysqlhighavailability.com">Replication team</a>.</p>Tiago ValeAs of today I’m a Software Engineer at Oracle, working on the MySQL Replication team.Paper published2016-12-19T00:00:00+00:002016-12-19T00:00:00+00:00https://tvale.github.io/pot<p>Our work on Pot was accepted at <a href="http://taco.acm.org">ACM TACO</a> and I will be presenting it
at <a href="http://www.hipeac.net/2017/stockholm/">HiPEAC 2017</a>.</p>Tiago ValeOur work on Pot was accepted at ACM TACO and I will be presenting it at HiPEAC 2017.Research internship2015-12-05T00:00:00+00:002015-12-05T00:00:00+00:00https://tvale.github.io/msr<p>From September 14th until yesterday I worked on the <a href="http://www.microsoft.com/en-us/research/project/farm/">FaRM</a> project as a
reseach intern at <a href="http://www.microsoft.com/en-us/research/lab/microsoft-research-cambridge/">Microsoft Research</a>.</p>Tiago ValeFrom September 14th until yesterday I worked on the FaRM project as a reseach intern at Microsoft Research.